16f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28a1ab315SDavid Howells #ifndef _UAPI__ASM_GENERIC_SIGNAL_H
38a1ab315SDavid Howells #define _UAPI__ASM_GENERIC_SIGNAL_H
48a1ab315SDavid Howells 
58a1ab315SDavid Howells #include <linux/types.h>
68a1ab315SDavid Howells 
78a1ab315SDavid Howells #define _NSIG		64
88a1ab315SDavid Howells #define _NSIG_BPW	__BITS_PER_LONG
98a1ab315SDavid Howells #define _NSIG_WORDS	(_NSIG / _NSIG_BPW)
108a1ab315SDavid Howells 
118a1ab315SDavid Howells #define SIGHUP		 1
128a1ab315SDavid Howells #define SIGINT		 2
138a1ab315SDavid Howells #define SIGQUIT		 3
148a1ab315SDavid Howells #define SIGILL		 4
158a1ab315SDavid Howells #define SIGTRAP		 5
168a1ab315SDavid Howells #define SIGABRT		 6
178a1ab315SDavid Howells #define SIGIOT		 6
188a1ab315SDavid Howells #define SIGBUS		 7
198a1ab315SDavid Howells #define SIGFPE		 8
208a1ab315SDavid Howells #define SIGKILL		 9
218a1ab315SDavid Howells #define SIGUSR1		10
228a1ab315SDavid Howells #define SIGSEGV		11
238a1ab315SDavid Howells #define SIGUSR2		12
248a1ab315SDavid Howells #define SIGPIPE		13
258a1ab315SDavid Howells #define SIGALRM		14
268a1ab315SDavid Howells #define SIGTERM		15
278a1ab315SDavid Howells #define SIGSTKFLT	16
288a1ab315SDavid Howells #define SIGCHLD		17
298a1ab315SDavid Howells #define SIGCONT		18
308a1ab315SDavid Howells #define SIGSTOP		19
318a1ab315SDavid Howells #define SIGTSTP		20
328a1ab315SDavid Howells #define SIGTTIN		21
338a1ab315SDavid Howells #define SIGTTOU		22
348a1ab315SDavid Howells #define SIGURG		23
358a1ab315SDavid Howells #define SIGXCPU		24
368a1ab315SDavid Howells #define SIGXFSZ		25
378a1ab315SDavid Howells #define SIGVTALRM	26
388a1ab315SDavid Howells #define SIGPROF		27
398a1ab315SDavid Howells #define SIGWINCH	28
408a1ab315SDavid Howells #define SIGIO		29
418a1ab315SDavid Howells #define SIGPOLL		SIGIO
428a1ab315SDavid Howells /*
438a1ab315SDavid Howells #define SIGLOST		29
448a1ab315SDavid Howells */
458a1ab315SDavid Howells #define SIGPWR		30
468a1ab315SDavid Howells #define SIGSYS		31
478a1ab315SDavid Howells #define	SIGUNUSED	31
488a1ab315SDavid Howells 
498a1ab315SDavid Howells /* These should not be considered constants from userland.  */
508a1ab315SDavid Howells #define SIGRTMIN	32
518a1ab315SDavid Howells #ifndef SIGRTMAX
528a1ab315SDavid Howells #define SIGRTMAX	_NSIG
538a1ab315SDavid Howells #endif
548a1ab315SDavid Howells 
558a1ab315SDavid Howells /*
568a1ab315SDavid Howells  * SA_FLAGS values:
578a1ab315SDavid Howells  *
588a1ab315SDavid Howells  * SA_ONSTACK indicates that a registered stack_t will be used.
598a1ab315SDavid Howells  * SA_RESTART flag to get restarting signals (which were the default long ago)
608a1ab315SDavid Howells  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
618a1ab315SDavid Howells  * SA_RESETHAND clears the handler when the signal is delivered.
628a1ab315SDavid Howells  * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
638a1ab315SDavid Howells  * SA_NODEFER prevents the current signal from being masked in the handler.
648a1ab315SDavid Howells  *
658a1ab315SDavid Howells  * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
668a1ab315SDavid Howells  * Unix names RESETHAND and NODEFER respectively.
678a1ab315SDavid Howells  */
688a1ab315SDavid Howells #define SA_NOCLDSTOP	0x00000001
698a1ab315SDavid Howells #define SA_NOCLDWAIT	0x00000002
708a1ab315SDavid Howells #define SA_SIGINFO	0x00000004
718a1ab315SDavid Howells #define SA_ONSTACK	0x08000000
728a1ab315SDavid Howells #define SA_RESTART	0x10000000
738a1ab315SDavid Howells #define SA_NODEFER	0x40000000
748a1ab315SDavid Howells #define SA_RESETHAND	0x80000000
758a1ab315SDavid Howells 
768a1ab315SDavid Howells #define SA_NOMASK	SA_NODEFER
778a1ab315SDavid Howells #define SA_ONESHOT	SA_RESETHAND
788a1ab315SDavid Howells 
798a1ab315SDavid Howells /*
808a1ab315SDavid Howells  * New architectures should not define the obsolete
818a1ab315SDavid Howells  *	SA_RESTORER	0x04000000
828a1ab315SDavid Howells  */
838a1ab315SDavid Howells 
84c9692657SManjeet Pawar #if !defined MINSIGSTKSZ || !defined SIGSTKSZ
858a1ab315SDavid Howells #define MINSIGSTKSZ	2048
868a1ab315SDavid Howells #define SIGSTKSZ	8192
87c9692657SManjeet Pawar #endif
888a1ab315SDavid Howells 
898a1ab315SDavid Howells #ifndef __ASSEMBLY__
908a1ab315SDavid Howells typedef struct {
918a1ab315SDavid Howells 	unsigned long sig[_NSIG_WORDS];
928a1ab315SDavid Howells } sigset_t;
938a1ab315SDavid Howells 
948a1ab315SDavid Howells /* not actually used, but required for linux/syscalls.h */
958a1ab315SDavid Howells typedef unsigned long old_sigset_t;
968a1ab315SDavid Howells 
978a1ab315SDavid Howells #include <asm-generic/signal-defs.h>
988a1ab315SDavid Howells 
99574c4866SAl Viro #ifdef SA_RESTORER
100574c4866SAl Viro #define __ARCH_HAS_SA_RESTORER
101574c4866SAl Viro #endif
102574c4866SAl Viro 
103574c4866SAl Viro #ifndef __KERNEL__
1048a1ab315SDavid Howells struct sigaction {
1058a1ab315SDavid Howells 	__sighandler_t sa_handler;
1068a1ab315SDavid Howells 	unsigned long sa_flags;
1078a1ab315SDavid Howells #ifdef SA_RESTORER
1088a1ab315SDavid Howells 	__sigrestore_t sa_restorer;
1098a1ab315SDavid Howells #endif
1108a1ab315SDavid Howells 	sigset_t sa_mask;		/* mask last for extensibility */
1118a1ab315SDavid Howells };
112574c4866SAl Viro #endif
1138a1ab315SDavid Howells 
1148a1ab315SDavid Howells typedef struct sigaltstack {
1158a1ab315SDavid Howells 	void __user *ss_sp;
1168a1ab315SDavid Howells 	int ss_flags;
1178a1ab315SDavid Howells 	size_t ss_size;
1188a1ab315SDavid Howells } stack_t;
1198a1ab315SDavid Howells 
1208a1ab315SDavid Howells #endif /* __ASSEMBLY__ */
1218a1ab315SDavid Howells 
1228a1ab315SDavid Howells #endif /* _UAPI__ASM_GENERIC_SIGNAL_H */
123