162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
462306a36Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
562306a36Sopenharmony_ci * for more details.
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * Copyright (C) 1995, 96, 97, 98, 99, 2003 by Ralf Baechle
862306a36Sopenharmony_ci * Copyright (C) 1999 Silicon Graphics, Inc.
962306a36Sopenharmony_ci */
1062306a36Sopenharmony_ci#ifndef _UAPI_ASM_SIGNAL_H
1162306a36Sopenharmony_ci#define _UAPI_ASM_SIGNAL_H
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci#include <linux/types.h>
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci#define _NSIG		128
1662306a36Sopenharmony_ci#define _NSIG_BPW	(sizeof(unsigned long) * 8)
1762306a36Sopenharmony_ci#define _NSIG_WORDS	(_NSIG / _NSIG_BPW)
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_citypedef struct {
2062306a36Sopenharmony_ci	unsigned long sig[_NSIG_WORDS];
2162306a36Sopenharmony_ci} sigset_t;
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_citypedef unsigned long old_sigset_t;		/* at least 32 bits */
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci#define SIGHUP		 1	/* Hangup (POSIX).  */
2662306a36Sopenharmony_ci#define SIGINT		 2	/* Interrupt (ANSI).  */
2762306a36Sopenharmony_ci#define SIGQUIT		 3	/* Quit (POSIX).  */
2862306a36Sopenharmony_ci#define SIGILL		 4	/* Illegal instruction (ANSI).	*/
2962306a36Sopenharmony_ci#define SIGTRAP		 5	/* Trace trap (POSIX).	*/
3062306a36Sopenharmony_ci#define SIGIOT		 6	/* IOT trap (4.2 BSD).	*/
3162306a36Sopenharmony_ci#define SIGABRT		 SIGIOT /* Abort (ANSI).  */
3262306a36Sopenharmony_ci#define SIGEMT		 7
3362306a36Sopenharmony_ci#define SIGFPE		 8	/* Floating-point exception (ANSI).  */
3462306a36Sopenharmony_ci#define SIGKILL		 9	/* Kill, unblockable (POSIX).  */
3562306a36Sopenharmony_ci#define SIGBUS		10	/* BUS error (4.2 BSD).	 */
3662306a36Sopenharmony_ci#define SIGSEGV		11	/* Segmentation violation (ANSI).  */
3762306a36Sopenharmony_ci#define SIGSYS		12
3862306a36Sopenharmony_ci#define SIGPIPE		13	/* Broken pipe (POSIX).	 */
3962306a36Sopenharmony_ci#define SIGALRM		14	/* Alarm clock (POSIX).	 */
4062306a36Sopenharmony_ci#define SIGTERM		15	/* Termination (ANSI).	*/
4162306a36Sopenharmony_ci#define SIGUSR1		16	/* User-defined signal 1 (POSIX).  */
4262306a36Sopenharmony_ci#define SIGUSR2		17	/* User-defined signal 2 (POSIX).  */
4362306a36Sopenharmony_ci#define SIGCHLD		18	/* Child status has changed (POSIX).  */
4462306a36Sopenharmony_ci#define SIGCLD		SIGCHLD /* Same as SIGCHLD (System V).	*/
4562306a36Sopenharmony_ci#define SIGPWR		19	/* Power failure restart (System V).  */
4662306a36Sopenharmony_ci#define SIGWINCH	20	/* Window size change (4.3 BSD, Sun).  */
4762306a36Sopenharmony_ci#define SIGURG		21	/* Urgent condition on socket (4.2 BSD).  */
4862306a36Sopenharmony_ci#define SIGIO		22	/* I/O now possible (4.2 BSD).	*/
4962306a36Sopenharmony_ci#define SIGPOLL		SIGIO	/* Pollable event occurred (System V).	*/
5062306a36Sopenharmony_ci#define SIGSTOP		23	/* Stop, unblockable (POSIX).  */
5162306a36Sopenharmony_ci#define SIGTSTP		24	/* Keyboard stop (POSIX).  */
5262306a36Sopenharmony_ci#define SIGCONT		25	/* Continue (POSIX).  */
5362306a36Sopenharmony_ci#define SIGTTIN		26	/* Background read from tty (POSIX).  */
5462306a36Sopenharmony_ci#define SIGTTOU		27	/* Background write to tty (POSIX).  */
5562306a36Sopenharmony_ci#define SIGVTALRM	28	/* Virtual alarm clock (4.2 BSD).  */
5662306a36Sopenharmony_ci#define SIGPROF		29	/* Profiling alarm clock (4.2 BSD).  */
5762306a36Sopenharmony_ci#define SIGXCPU		30	/* CPU limit exceeded (4.2 BSD).  */
5862306a36Sopenharmony_ci#define SIGXFSZ		31	/* File size limit exceeded (4.2 BSD).	*/
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ci/* These should not be considered constants from userland.  */
6162306a36Sopenharmony_ci#define SIGRTMIN	32
6262306a36Sopenharmony_ci#define SIGRTMAX	_NSIG
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ci/*
6562306a36Sopenharmony_ci * SA_RESTORER used to be defined as 0x04000000 but only the O32 ABI ever
6662306a36Sopenharmony_ci * supported its use and no libc was using it, so the entire sa-restorer
6762306a36Sopenharmony_ci * functionality was removed with lmo commit 39bffc12c3580ab for 2.5.48
6862306a36Sopenharmony_ci * retaining only the SA_RESTORER definition as a reminder to avoid
6962306a36Sopenharmony_ci * accidental reuse of the mask bit.
7062306a36Sopenharmony_ci */
7162306a36Sopenharmony_ci#define SA_ONSTACK	0x08000000
7262306a36Sopenharmony_ci#define SA_RESETHAND	0x80000000
7362306a36Sopenharmony_ci#define SA_RESTART	0x10000000
7462306a36Sopenharmony_ci#define SA_SIGINFO	0x00000008
7562306a36Sopenharmony_ci#define SA_NODEFER	0x40000000
7662306a36Sopenharmony_ci#define SA_NOCLDWAIT	0x00010000
7762306a36Sopenharmony_ci#define SA_NOCLDSTOP	0x00000001
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ci#define SA_NOMASK	SA_NODEFER
8062306a36Sopenharmony_ci#define SA_ONESHOT	SA_RESETHAND
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ci#define MINSIGSTKSZ    2048
8362306a36Sopenharmony_ci#define SIGSTKSZ       8192
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_ci#define SIG_BLOCK	1	/* for blocking signals */
8762306a36Sopenharmony_ci#define SIG_UNBLOCK	2	/* for unblocking signals */
8862306a36Sopenharmony_ci#define SIG_SETMASK	3	/* for setting the signal mask */
8962306a36Sopenharmony_ci
9062306a36Sopenharmony_ci#include <asm-generic/signal-defs.h>
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ci#ifndef __KERNEL__
9362306a36Sopenharmony_cistruct sigaction {
9462306a36Sopenharmony_ci	unsigned int	sa_flags;
9562306a36Sopenharmony_ci	__sighandler_t	sa_handler;
9662306a36Sopenharmony_ci	sigset_t	sa_mask;
9762306a36Sopenharmony_ci};
9862306a36Sopenharmony_ci#endif
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_ci/* IRIX compatible stack_t  */
10162306a36Sopenharmony_citypedef struct sigaltstack {
10262306a36Sopenharmony_ci	void __user *ss_sp;
10362306a36Sopenharmony_ci	__kernel_size_t ss_size;
10462306a36Sopenharmony_ci	int ss_flags;
10562306a36Sopenharmony_ci} stack_t;
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_ci
10862306a36Sopenharmony_ci#endif /* _UAPI_ASM_SIGNAL_H */
109