[PATCH v9 2/6] arch: move SA_* definitions to generic headers

Geert Uytterhoeven geert at linux-m68k.org
Wed Aug 19 03:13:49 EDT 2020


Hi Peter,

On Tue, Aug 18, 2020 at 5:39 AM Peter Collingbourne <pcc at google.com> wrote:
> Most architectures with the exception of alpha, mips, parisc and
> sparc use the same values for these flags. Move their definitions into
> asm-generic/signal-defs.h and allow the architectures with non-standard
> values to override them. Also, document the non-standard flag values
> in order to make it easier to add new generic flags in the future.
>
> Signed-off-by: Peter Collingbourne <pcc at google.com>

Thanks for your patch!

>  arch/m68k/include/uapi/asm/signal.h    | 24 -------------

Acked-by: Geert Uytterhoeven <geert at linux-m68k.org>

> --- a/include/uapi/asm-generic/signal-defs.h
> +++ b/include/uapi/asm-generic/signal-defs.h
> @@ -4,6 +4,53 @@
>
>  #include <linux/compiler.h>
>
> +/*
> + * SA_FLAGS values:
> + *
> + * SA_ONSTACK indicates that a registered stack_t will be used.
> + * SA_RESTART flag to get restarting signals (which were the default long ago)
> + * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
> + * SA_RESETHAND clears the handler when the signal is delivered.
> + * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
> + * SA_NODEFER prevents the current signal from being masked in the handler.

Perhaps the order should match the order of the definitions below?
Then it becomes obvious SA_SIGINFO is not documented (it was on arm).

> + *
> + * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
> + * Unix names RESETHAND and NODEFER respectively.

I think moving this last comment below, just above the definitions of
SA_NOMASK and SA_ONESHOT, would make this easier to read.

> + */
> +#ifndef SA_NOCLDSTOP
> +#define SA_NOCLDSTOP   0x00000001
> +#endif
> +#ifndef SA_NOCLDWAIT
> +#define SA_NOCLDWAIT   0x00000002
> +#endif
> +#ifndef SA_SIGINFO
> +#define SA_SIGINFO     0x00000004
> +#endif
> +#ifndef SA_ONSTACK
> +#define SA_ONSTACK     0x08000000
> +#endif
> +#ifndef SA_RESTART
> +#define SA_RESTART     0x10000000
> +#endif
> +#ifndef SA_NODEFER
> +#define SA_NODEFER     0x40000000
> +#endif
> +#ifndef SA_RESETHAND
> +#define SA_RESETHAND   0x80000000
> +#endif
> +/*
> + * The following bits are used in architecture-specific SA_* definitions and
> + * should be avoided for new generic flags: 3, 4, 5, 6, 7, 8, 9, 16, 24, 25, 26.

And I think this belongs to the previous comment block.

> + */
> +
> +#define SA_NOMASK      SA_NODEFER
> +#define SA_ONESHOT     SA_RESETHAND
> +
> +/*
> + * New architectures should not define the obsolete
> + *     SA_RESTORER     0x04000000
> + */
> +
>  #ifndef SIG_BLOCK
>  #define SIG_BLOCK          0   /* for blocking signals */
>  #endif

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



More information about the linux-arm-kernel mailing list