162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 262306a36Sopenharmony_ci#ifndef __ASM_GENERIC_SIGNAL_DEFS_H 362306a36Sopenharmony_ci#define __ASM_GENERIC_SIGNAL_DEFS_H 462306a36Sopenharmony_ci 562306a36Sopenharmony_ci#include <linux/compiler.h> 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci/* 862306a36Sopenharmony_ci * SA_FLAGS values: 962306a36Sopenharmony_ci * 1062306a36Sopenharmony_ci * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. 1162306a36Sopenharmony_ci * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. 1262306a36Sopenharmony_ci * SA_SIGINFO delivers the signal with SIGINFO structs. 1362306a36Sopenharmony_ci * SA_ONSTACK indicates that a registered stack_t will be used. 1462306a36Sopenharmony_ci * SA_RESTART flag to get restarting signals (which were the default long ago) 1562306a36Sopenharmony_ci * SA_NODEFER prevents the current signal from being masked in the handler. 1662306a36Sopenharmony_ci * SA_RESETHAND clears the handler when the signal is delivered. 1762306a36Sopenharmony_ci * SA_UNSUPPORTED is a flag bit that will never be supported. Kernels from 1862306a36Sopenharmony_ci * before the introduction of SA_UNSUPPORTED did not clear unknown bits from 1962306a36Sopenharmony_ci * sa_flags when read using the oldact argument to sigaction and rt_sigaction, 2062306a36Sopenharmony_ci * so this bit allows flag bit support to be detected from userspace while 2162306a36Sopenharmony_ci * allowing an old kernel to be distinguished from a kernel that supports every 2262306a36Sopenharmony_ci * flag bit. 2362306a36Sopenharmony_ci * SA_EXPOSE_TAGBITS exposes an architecture-defined set of tag bits in 2462306a36Sopenharmony_ci * siginfo.si_addr. 2562306a36Sopenharmony_ci * 2662306a36Sopenharmony_ci * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single 2762306a36Sopenharmony_ci * Unix names RESETHAND and NODEFER respectively. 2862306a36Sopenharmony_ci */ 2962306a36Sopenharmony_ci#ifndef SA_NOCLDSTOP 3062306a36Sopenharmony_ci#define SA_NOCLDSTOP 0x00000001 3162306a36Sopenharmony_ci#endif 3262306a36Sopenharmony_ci#ifndef SA_NOCLDWAIT 3362306a36Sopenharmony_ci#define SA_NOCLDWAIT 0x00000002 3462306a36Sopenharmony_ci#endif 3562306a36Sopenharmony_ci#ifndef SA_SIGINFO 3662306a36Sopenharmony_ci#define SA_SIGINFO 0x00000004 3762306a36Sopenharmony_ci#endif 3862306a36Sopenharmony_ci/* 0x00000008 used on alpha, mips, parisc */ 3962306a36Sopenharmony_ci/* 0x00000010 used on alpha, parisc */ 4062306a36Sopenharmony_ci/* 0x00000020 used on alpha, parisc, sparc */ 4162306a36Sopenharmony_ci/* 0x00000040 used on alpha, parisc */ 4262306a36Sopenharmony_ci/* 0x00000080 used on parisc */ 4362306a36Sopenharmony_ci/* 0x00000100 used on sparc */ 4462306a36Sopenharmony_ci/* 0x00000200 used on sparc */ 4562306a36Sopenharmony_ci#define SA_UNSUPPORTED 0x00000400 4662306a36Sopenharmony_ci#define SA_EXPOSE_TAGBITS 0x00000800 4762306a36Sopenharmony_ci/* 0x00010000 used on mips */ 4862306a36Sopenharmony_ci/* 0x00800000 used for internal SA_IMMUTABLE */ 4962306a36Sopenharmony_ci/* 0x01000000 used on x86 */ 5062306a36Sopenharmony_ci/* 0x02000000 used on x86 */ 5162306a36Sopenharmony_ci/* 5262306a36Sopenharmony_ci * New architectures should not define the obsolete 5362306a36Sopenharmony_ci * SA_RESTORER 0x04000000 5462306a36Sopenharmony_ci */ 5562306a36Sopenharmony_ci#ifndef SA_ONSTACK 5662306a36Sopenharmony_ci#define SA_ONSTACK 0x08000000 5762306a36Sopenharmony_ci#endif 5862306a36Sopenharmony_ci#ifndef SA_RESTART 5962306a36Sopenharmony_ci#define SA_RESTART 0x10000000 6062306a36Sopenharmony_ci#endif 6162306a36Sopenharmony_ci#ifndef SA_NODEFER 6262306a36Sopenharmony_ci#define SA_NODEFER 0x40000000 6362306a36Sopenharmony_ci#endif 6462306a36Sopenharmony_ci#ifndef SA_RESETHAND 6562306a36Sopenharmony_ci#define SA_RESETHAND 0x80000000 6662306a36Sopenharmony_ci#endif 6762306a36Sopenharmony_ci 6862306a36Sopenharmony_ci#define SA_NOMASK SA_NODEFER 6962306a36Sopenharmony_ci#define SA_ONESHOT SA_RESETHAND 7062306a36Sopenharmony_ci 7162306a36Sopenharmony_ci#ifndef SIG_BLOCK 7262306a36Sopenharmony_ci#define SIG_BLOCK 0 /* for blocking signals */ 7362306a36Sopenharmony_ci#endif 7462306a36Sopenharmony_ci#ifndef SIG_UNBLOCK 7562306a36Sopenharmony_ci#define SIG_UNBLOCK 1 /* for unblocking signals */ 7662306a36Sopenharmony_ci#endif 7762306a36Sopenharmony_ci#ifndef SIG_SETMASK 7862306a36Sopenharmony_ci#define SIG_SETMASK 2 /* for setting the signal mask */ 7962306a36Sopenharmony_ci#endif 8062306a36Sopenharmony_ci 8162306a36Sopenharmony_ci#ifndef __ASSEMBLY__ 8262306a36Sopenharmony_citypedef void __signalfn_t(int); 8362306a36Sopenharmony_citypedef __signalfn_t __user *__sighandler_t; 8462306a36Sopenharmony_ci 8562306a36Sopenharmony_citypedef void __restorefn_t(void); 8662306a36Sopenharmony_citypedef __restorefn_t __user *__sigrestore_t; 8762306a36Sopenharmony_ci 8862306a36Sopenharmony_ci#define SIG_DFL ((__force __sighandler_t)0) /* default signal handling */ 8962306a36Sopenharmony_ci#define SIG_IGN ((__force __sighandler_t)1) /* ignore signal */ 9062306a36Sopenharmony_ci#define SIG_ERR ((__force __sighandler_t)-1) /* error return from signal */ 9162306a36Sopenharmony_ci#endif 9262306a36Sopenharmony_ci 9362306a36Sopenharmony_ci#endif /* __ASM_GENERIC_SIGNAL_DEFS_H */ 94