History

arch: provide better documentation for the arch-specific SA_* flags

Instead of documenting the arch-specific flag values in a comment at the top where they may be easily overlooked, document them in comments inline with the definitions in numerical order so that it is clear why specific values must be chosen for new generic flags and to reduce the likelihood of conflicts between generic and arch-specific flags.

Peter Collingbourne committed 5 years ago

Commit 7da50821 parent 23acdc71 file · +14 −8Browse files

Unified · Split

include/uapi/asm-generic/signal-defs.h+14−8
@@ -17,9 +17,6 @@ · 16 unmodified lines
17 *17 *
18 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single18 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
19 * Unix names RESETHAND and NODEFER respectively.19 * Unix names RESETHAND and NODEFER respectively.
20 *
21 * The following bits are used in architecture-specific SA_* definitions and
22 * should be avoided for new generic flags: 3, 4, 5, 6, 7, 8, 9, 16, 24, 25, 26.
23 */20 */
24#ifndef SA_NOCLDSTOP21#ifndef SA_NOCLDSTOP
25#define SA_NOCLDSTOP 0x0000000122#define SA_NOCLDSTOP 0x00000001
@@ -30,6 +27,20 @@ · 4 unmodified lines
30#ifndef SA_SIGINFO27#ifndef SA_SIGINFO
31#define SA_SIGINFO 0x0000000428#define SA_SIGINFO 0x00000004
32#endif29#endif
30/* 0x00000008 used on alpha, mips, parisc */
31/* 0x00000010 used on alpha, parisc */
32/* 0x00000020 used on alpha, parisc, sparc */
33/* 0x00000040 used on alpha, parisc */
34/* 0x00000080 used on parisc */
35/* 0x00000100 used on sparc */
36/* 0x00000200 used on sparc */
37/* 0x00010000 used on mips */
38/* 0x01000000 used on x86 */
39/* 0x02000000 used on x86 */
40/*
41 * New architectures should not define the obsolete
42 * SA_RESTORER 0x04000000
43 */
33#ifndef SA_ONSTACK44#ifndef SA_ONSTACK
34#define SA_ONSTACK 0x0800000045#define SA_ONSTACK 0x08000000
35#endif46#endif
@@ -46,11 +57,6 @@ · 10 unmodified lines
46#define SA_NOMASK SA_NODEFER57#define SA_NOMASK SA_NODEFER
47#define SA_ONESHOT SA_RESETHAND58#define SA_ONESHOT SA_RESETHAND
48 59
49/*
50 * New architectures should not define the obsolete
51 * SA_RESTORER 0x04000000
52 */
53
54#ifndef SIG_BLOCK60#ifndef SIG_BLOCK
55#define SIG_BLOCK 0 /* for blocking signals */61#define SIG_BLOCK 0 /* for blocking signals */
56#endif62#endif