xref: /OK3568_Linux_fs/kernel/include/uapi/asm-generic/signal-defs.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2*4882a593Smuzhiyun #ifndef __ASM_GENERIC_SIGNAL_DEFS_H
3*4882a593Smuzhiyun #define __ASM_GENERIC_SIGNAL_DEFS_H
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun #include <linux/compiler.h>
6*4882a593Smuzhiyun 
7*4882a593Smuzhiyun /*
8*4882a593Smuzhiyun  * SA_FLAGS values:
9*4882a593Smuzhiyun  *
10*4882a593Smuzhiyun  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
11*4882a593Smuzhiyun  * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
12*4882a593Smuzhiyun  * SA_SIGINFO delivers the signal with SIGINFO structs.
13*4882a593Smuzhiyun  * SA_ONSTACK indicates that a registered stack_t will be used.
14*4882a593Smuzhiyun  * SA_RESTART flag to get restarting signals (which were the default long ago)
15*4882a593Smuzhiyun  * SA_NODEFER prevents the current signal from being masked in the handler.
16*4882a593Smuzhiyun  * SA_RESETHAND clears the handler when the signal is delivered.
17*4882a593Smuzhiyun  * SA_UNSUPPORTED is a flag bit that will never be supported. Kernels from
18*4882a593Smuzhiyun  * before the introduction of SA_UNSUPPORTED did not clear unknown bits from
19*4882a593Smuzhiyun  * sa_flags when read using the oldact argument to sigaction and rt_sigaction,
20*4882a593Smuzhiyun  * so this bit allows flag bit support to be detected from userspace while
21*4882a593Smuzhiyun  * allowing an old kernel to be distinguished from a kernel that supports every
22*4882a593Smuzhiyun  * flag bit.
23*4882a593Smuzhiyun  * SA_EXPOSE_TAGBITS exposes an architecture-defined set of tag bits in
24*4882a593Smuzhiyun  * siginfo.si_addr.
25*4882a593Smuzhiyun  *
26*4882a593Smuzhiyun  * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
27*4882a593Smuzhiyun  * Unix names RESETHAND and NODEFER respectively.
28*4882a593Smuzhiyun  */
29*4882a593Smuzhiyun #ifndef SA_NOCLDSTOP
30*4882a593Smuzhiyun #define SA_NOCLDSTOP	0x00000001
31*4882a593Smuzhiyun #endif
32*4882a593Smuzhiyun #ifndef SA_NOCLDWAIT
33*4882a593Smuzhiyun #define SA_NOCLDWAIT	0x00000002
34*4882a593Smuzhiyun #endif
35*4882a593Smuzhiyun #ifndef SA_SIGINFO
36*4882a593Smuzhiyun #define SA_SIGINFO	0x00000004
37*4882a593Smuzhiyun #endif
38*4882a593Smuzhiyun /* 0x00000008 used on alpha, mips, parisc */
39*4882a593Smuzhiyun /* 0x00000010 used on alpha, parisc */
40*4882a593Smuzhiyun /* 0x00000020 used on alpha, parisc, sparc */
41*4882a593Smuzhiyun /* 0x00000040 used on alpha, parisc */
42*4882a593Smuzhiyun /* 0x00000080 used on parisc */
43*4882a593Smuzhiyun /* 0x00000100 used on sparc */
44*4882a593Smuzhiyun /* 0x00000200 used on sparc */
45*4882a593Smuzhiyun #define SA_UNSUPPORTED	0x00000400
46*4882a593Smuzhiyun #define SA_EXPOSE_TAGBITS	0x00000800
47*4882a593Smuzhiyun /* 0x00010000 used on mips */
48*4882a593Smuzhiyun /* 0x01000000 used on x86 */
49*4882a593Smuzhiyun /* 0x02000000 used on x86 */
50*4882a593Smuzhiyun /*
51*4882a593Smuzhiyun  * New architectures should not define the obsolete
52*4882a593Smuzhiyun  *	SA_RESTORER	0x04000000
53*4882a593Smuzhiyun  */
54*4882a593Smuzhiyun #ifndef SA_ONSTACK
55*4882a593Smuzhiyun #define SA_ONSTACK	0x08000000
56*4882a593Smuzhiyun #endif
57*4882a593Smuzhiyun #ifndef SA_RESTART
58*4882a593Smuzhiyun #define SA_RESTART	0x10000000
59*4882a593Smuzhiyun #endif
60*4882a593Smuzhiyun #ifndef SA_NODEFER
61*4882a593Smuzhiyun #define SA_NODEFER	0x40000000
62*4882a593Smuzhiyun #endif
63*4882a593Smuzhiyun #ifndef SA_RESETHAND
64*4882a593Smuzhiyun #define SA_RESETHAND	0x80000000
65*4882a593Smuzhiyun #endif
66*4882a593Smuzhiyun 
67*4882a593Smuzhiyun #define SA_NOMASK	SA_NODEFER
68*4882a593Smuzhiyun #define SA_ONESHOT	SA_RESETHAND
69*4882a593Smuzhiyun 
70*4882a593Smuzhiyun #ifndef SIG_BLOCK
71*4882a593Smuzhiyun #define SIG_BLOCK          0	/* for blocking signals */
72*4882a593Smuzhiyun #endif
73*4882a593Smuzhiyun #ifndef SIG_UNBLOCK
74*4882a593Smuzhiyun #define SIG_UNBLOCK        1	/* for unblocking signals */
75*4882a593Smuzhiyun #endif
76*4882a593Smuzhiyun #ifndef SIG_SETMASK
77*4882a593Smuzhiyun #define SIG_SETMASK        2	/* for setting the signal mask */
78*4882a593Smuzhiyun #endif
79*4882a593Smuzhiyun 
80*4882a593Smuzhiyun #ifndef __ASSEMBLY__
81*4882a593Smuzhiyun typedef void __signalfn_t(int);
82*4882a593Smuzhiyun typedef __signalfn_t __user *__sighandler_t;
83*4882a593Smuzhiyun 
84*4882a593Smuzhiyun typedef void __restorefn_t(void);
85*4882a593Smuzhiyun typedef __restorefn_t __user *__sigrestore_t;
86*4882a593Smuzhiyun 
87*4882a593Smuzhiyun #define SIG_DFL	((__force __sighandler_t)0)	/* default signal handling */
88*4882a593Smuzhiyun #define SIG_IGN	((__force __sighandler_t)1)	/* ignore signal */
89*4882a593Smuzhiyun #define SIG_ERR	((__force __sighandler_t)-1)	/* error return from signal */
90*4882a593Smuzhiyun #endif
91*4882a593Smuzhiyun 
92*4882a593Smuzhiyun #endif /* __ASM_GENERIC_SIGNAL_DEFS_H */
93