18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
48c2ecf20Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
58c2ecf20Sopenharmony_ci * for more details.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (C) 1995, 96, 97, 98, 99, 2003 by Ralf Baechle
88c2ecf20Sopenharmony_ci * Copyright (C) 1999 Silicon Graphics, Inc.
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci#ifndef _UAPI_ASM_SIGNAL_H
118c2ecf20Sopenharmony_ci#define _UAPI_ASM_SIGNAL_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <linux/types.h>
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#define _NSIG		128
168c2ecf20Sopenharmony_ci#define _NSIG_BPW	(sizeof(unsigned long) * 8)
178c2ecf20Sopenharmony_ci#define _NSIG_WORDS	(_NSIG / _NSIG_BPW)
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_citypedef struct {
208c2ecf20Sopenharmony_ci	unsigned long sig[_NSIG_WORDS];
218c2ecf20Sopenharmony_ci} sigset_t;
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_citypedef unsigned long old_sigset_t;		/* at least 32 bits */
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#define SIGHUP		 1	/* Hangup (POSIX).  */
268c2ecf20Sopenharmony_ci#define SIGINT		 2	/* Interrupt (ANSI).  */
278c2ecf20Sopenharmony_ci#define SIGQUIT		 3	/* Quit (POSIX).  */
288c2ecf20Sopenharmony_ci#define SIGILL		 4	/* Illegal instruction (ANSI).	*/
298c2ecf20Sopenharmony_ci#define SIGTRAP		 5	/* Trace trap (POSIX).	*/
308c2ecf20Sopenharmony_ci#define SIGIOT		 6	/* IOT trap (4.2 BSD).	*/
318c2ecf20Sopenharmony_ci#define SIGABRT		 SIGIOT /* Abort (ANSI).  */
328c2ecf20Sopenharmony_ci#define SIGEMT		 7
338c2ecf20Sopenharmony_ci#define SIGFPE		 8	/* Floating-point exception (ANSI).  */
348c2ecf20Sopenharmony_ci#define SIGKILL		 9	/* Kill, unblockable (POSIX).  */
358c2ecf20Sopenharmony_ci#define SIGBUS		10	/* BUS error (4.2 BSD).	 */
368c2ecf20Sopenharmony_ci#define SIGSEGV		11	/* Segmentation violation (ANSI).  */
378c2ecf20Sopenharmony_ci#define SIGSYS		12
388c2ecf20Sopenharmony_ci#define SIGPIPE		13	/* Broken pipe (POSIX).	 */
398c2ecf20Sopenharmony_ci#define SIGALRM		14	/* Alarm clock (POSIX).	 */
408c2ecf20Sopenharmony_ci#define SIGTERM		15	/* Termination (ANSI).	*/
418c2ecf20Sopenharmony_ci#define SIGUSR1		16	/* User-defined signal 1 (POSIX).  */
428c2ecf20Sopenharmony_ci#define SIGUSR2		17	/* User-defined signal 2 (POSIX).  */
438c2ecf20Sopenharmony_ci#define SIGCHLD		18	/* Child status has changed (POSIX).  */
448c2ecf20Sopenharmony_ci#define SIGCLD		SIGCHLD /* Same as SIGCHLD (System V).	*/
458c2ecf20Sopenharmony_ci#define SIGPWR		19	/* Power failure restart (System V).  */
468c2ecf20Sopenharmony_ci#define SIGWINCH	20	/* Window size change (4.3 BSD, Sun).  */
478c2ecf20Sopenharmony_ci#define SIGURG		21	/* Urgent condition on socket (4.2 BSD).  */
488c2ecf20Sopenharmony_ci#define SIGIO		22	/* I/O now possible (4.2 BSD).	*/
498c2ecf20Sopenharmony_ci#define SIGPOLL		SIGIO	/* Pollable event occurred (System V).	*/
508c2ecf20Sopenharmony_ci#define SIGSTOP		23	/* Stop, unblockable (POSIX).  */
518c2ecf20Sopenharmony_ci#define SIGTSTP		24	/* Keyboard stop (POSIX).  */
528c2ecf20Sopenharmony_ci#define SIGCONT		25	/* Continue (POSIX).  */
538c2ecf20Sopenharmony_ci#define SIGTTIN		26	/* Background read from tty (POSIX).  */
548c2ecf20Sopenharmony_ci#define SIGTTOU		27	/* Background write to tty (POSIX).  */
558c2ecf20Sopenharmony_ci#define SIGVTALRM	28	/* Virtual alarm clock (4.2 BSD).  */
568c2ecf20Sopenharmony_ci#define SIGPROF		29	/* Profiling alarm clock (4.2 BSD).  */
578c2ecf20Sopenharmony_ci#define SIGXCPU		30	/* CPU limit exceeded (4.2 BSD).  */
588c2ecf20Sopenharmony_ci#define SIGXFSZ		31	/* File size limit exceeded (4.2 BSD).	*/
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci/* These should not be considered constants from userland.  */
618c2ecf20Sopenharmony_ci#define SIGRTMIN	32
628c2ecf20Sopenharmony_ci#define SIGRTMAX	_NSIG
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci/*
658c2ecf20Sopenharmony_ci * SA_FLAGS values:
668c2ecf20Sopenharmony_ci *
678c2ecf20Sopenharmony_ci * SA_ONSTACK indicates that a registered stack_t will be used.
688c2ecf20Sopenharmony_ci * SA_RESTART flag to get restarting signals (which were the default long ago)
698c2ecf20Sopenharmony_ci * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
708c2ecf20Sopenharmony_ci * SA_RESETHAND clears the handler when the signal is delivered.
718c2ecf20Sopenharmony_ci * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
728c2ecf20Sopenharmony_ci * SA_NODEFER prevents the current signal from being masked in the handler.
738c2ecf20Sopenharmony_ci *
748c2ecf20Sopenharmony_ci * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
758c2ecf20Sopenharmony_ci * Unix names RESETHAND and NODEFER respectively.
768c2ecf20Sopenharmony_ci *
778c2ecf20Sopenharmony_ci * SA_RESTORER used to be defined as 0x04000000 but only the O32 ABI ever
788c2ecf20Sopenharmony_ci * supported its use and no libc was using it, so the entire sa-restorer
798c2ecf20Sopenharmony_ci * functionality was removed with lmo commit 39bffc12c3580ab for 2.5.48
808c2ecf20Sopenharmony_ci * retaining only the SA_RESTORER definition as a reminder to avoid
818c2ecf20Sopenharmony_ci * accidental reuse of the mask bit.
828c2ecf20Sopenharmony_ci */
838c2ecf20Sopenharmony_ci#define SA_ONSTACK	0x08000000
848c2ecf20Sopenharmony_ci#define SA_RESETHAND	0x80000000
858c2ecf20Sopenharmony_ci#define SA_RESTART	0x10000000
868c2ecf20Sopenharmony_ci#define SA_SIGINFO	0x00000008
878c2ecf20Sopenharmony_ci#define SA_NODEFER	0x40000000
888c2ecf20Sopenharmony_ci#define SA_NOCLDWAIT	0x00010000
898c2ecf20Sopenharmony_ci#define SA_NOCLDSTOP	0x00000001
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci#define SA_NOMASK	SA_NODEFER
928c2ecf20Sopenharmony_ci#define SA_ONESHOT	SA_RESETHAND
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci#define MINSIGSTKSZ    2048
958c2ecf20Sopenharmony_ci#define SIGSTKSZ       8192
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci#define SIG_BLOCK	1	/* for blocking signals */
998c2ecf20Sopenharmony_ci#define SIG_UNBLOCK	2	/* for unblocking signals */
1008c2ecf20Sopenharmony_ci#define SIG_SETMASK	3	/* for setting the signal mask */
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci#include <asm-generic/signal-defs.h>
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci#ifndef __KERNEL__
1058c2ecf20Sopenharmony_cistruct sigaction {
1068c2ecf20Sopenharmony_ci	unsigned int	sa_flags;
1078c2ecf20Sopenharmony_ci	__sighandler_t	sa_handler;
1088c2ecf20Sopenharmony_ci	sigset_t	sa_mask;
1098c2ecf20Sopenharmony_ci};
1108c2ecf20Sopenharmony_ci#endif
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci/* IRIX compatible stack_t  */
1138c2ecf20Sopenharmony_citypedef struct sigaltstack {
1148c2ecf20Sopenharmony_ci	void __user *ss_sp;
1158c2ecf20Sopenharmony_ci	size_t ss_size;
1168c2ecf20Sopenharmony_ci	int ss_flags;
1178c2ecf20Sopenharmony_ci} stack_t;
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci#endif /* _UAPI_ASM_SIGNAL_H */
121