[PATCH v13 3/8] arch: move SA_* definitions to generic headers

Peter Collingbourne pcc at google.com
Wed Nov 4 15:48:04 EST 2020


On Wed, Nov 4, 2020 at 10:48 AM Eric W. Biederman <ebiederm at xmission.com> wrote:
>
> Peter Collingbourne <pcc at google.com> writes:
>
> > 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.
> >
> > A consequence of this change is that on powerpc and x86, the constants'
> > values aside from SA_RESETHAND change signedness from unsigned
> > to signed. This is not expected to impact realistic use of these
> > constants. In particular the typical use of the constants where they
> > are or'ed together and assigned to sa_flags (or another int variable)
> > would not be affected.
>
> Except for the removal of SA_RESTORER on arm (see below).
> Acked-by: "Eric W. Biederman" <ebiederm at xmission.com>

Thanks for the review.

> >
> > Signed-off-by: Peter Collingbourne <pcc at google.com>
> > Acked-by: Geert Uytterhoeven <geert at linux-m68k.org>
> > Reviewed-by: Dave Martin <Dave.Martin at arm.com>
> > Link: https://linux-review.googlesource.com/id/Ia3849f18b8009bf41faca374e701cdca36974528
> > ---
> > v11:
> > - tweak the commit message to point out the change from unsigned
> >   to signed
> >
> > v10:
> > - move the comments around and add one for SA_SIGINFO
> >
>
> > diff --git a/arch/arm/include/uapi/asm/signal.h b/arch/arm/include/uapi/asm/signal.h
> > index 9b4185ba4f8a..7727f0984d26 100644
> > --- a/arch/arm/include/uapi/asm/signal.h
> > +++ b/arch/arm/include/uapi/asm/signal.h
> > @@ -60,33 +60,11 @@ typedef unsigned long sigset_t;
> >  #define SIGSWI               32
> >
> >  /*
> > - * SA_FLAGS values:
> > - *
> > - * SA_NOCLDSTOP              flag to turn off SIGCHLD when children stop.
> > - * SA_NOCLDWAIT              flag on SIGCHLD to inhibit zombies.
> > - * SA_SIGINFO                deliver the signal with SIGINFO structs
> > - * SA_THIRTYTWO              delivers the signal in 32-bit mode, even if the task
> > - *                   is running in 26-bit.
> > - * SA_ONSTACK                allows alternate signal stacks (see sigaltstack(2)).
> > - * SA_RESTART                flag to get restarting signals (which were the default long ago)
> > - * SA_NODEFER                prevents the current signal from being masked in the handler.
> > - * SA_RESETHAND              clears the handler when the signal is delivered.
> > - *
> > - * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
> > - * Unix names RESETHAND and NODEFER respectively.
> > + * SA_THIRTYTWO historically meant deliver the signal in 32-bit mode, even if
> > + * the task is running in 26-bit. But since the kernel no longer supports
> > + * 26-bit mode, the flag has no effect.
> >   */
> > -#define SA_NOCLDSTOP 0x00000001
> > -#define SA_NOCLDWAIT 0x00000002
> > -#define SA_SIGINFO   0x00000004
> >  #define SA_THIRTYTWO 0x02000000
>
> > -#define SA_RESTORER  0x04000000
>    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Was removing SA_RESTOER from arm a typo?
> If not it is probably better to move the removal into a separate patch.

Yes, that was a mistake, thanks for the catch. I'll fix it in v14.

Peter



More information about the linux-arm-kernel mailing list