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

Peter Collingbourne pcc at google.com
Wed Aug 19 18:44:08 EDT 2020


On Wed, Aug 19, 2020 at 12:14 AM Geert Uytterhoeven
<geert at linux-m68k.org> wrote:
>
> 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).

That makes sense. I'll copy the deleted arm comment for SA_SIGINFO here as well.

> > + *
> > + * 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.

I put the comment block here to make it more likely that it will be
seen when adding new flags, but either location is fine with me.

Peter



More information about the linux-arm-kernel mailing list