18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci#ifndef _UAPI_ASM_GENERIC_SIGINFO_H
38c2ecf20Sopenharmony_ci#define _UAPI_ASM_GENERIC_SIGINFO_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <linux/compiler.h>
68c2ecf20Sopenharmony_ci#include <linux/types.h>
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_citypedef union sigval {
98c2ecf20Sopenharmony_ci	int sival_int;
108c2ecf20Sopenharmony_ci	void __user *sival_ptr;
118c2ecf20Sopenharmony_ci} sigval_t;
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#define SI_MAX_SIZE	128
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci/*
168c2ecf20Sopenharmony_ci * The default "si_band" type is "long", as specified by POSIX.
178c2ecf20Sopenharmony_ci * However, some architectures want to override this to "int"
188c2ecf20Sopenharmony_ci * for historical compatibility reasons, so we allow that.
198c2ecf20Sopenharmony_ci */
208c2ecf20Sopenharmony_ci#ifndef __ARCH_SI_BAND_T
218c2ecf20Sopenharmony_ci#define __ARCH_SI_BAND_T long
228c2ecf20Sopenharmony_ci#endif
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#ifndef __ARCH_SI_CLOCK_T
258c2ecf20Sopenharmony_ci#define __ARCH_SI_CLOCK_T __kernel_clock_t
268c2ecf20Sopenharmony_ci#endif
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#ifndef __ARCH_SI_ATTRIBUTES
298c2ecf20Sopenharmony_ci#define __ARCH_SI_ATTRIBUTES
308c2ecf20Sopenharmony_ci#endif
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ciunion __sifields {
338c2ecf20Sopenharmony_ci	/* kill() */
348c2ecf20Sopenharmony_ci	struct {
358c2ecf20Sopenharmony_ci		__kernel_pid_t _pid;	/* sender's pid */
368c2ecf20Sopenharmony_ci		__kernel_uid32_t _uid;	/* sender's uid */
378c2ecf20Sopenharmony_ci	} _kill;
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci	/* POSIX.1b timers */
408c2ecf20Sopenharmony_ci	struct {
418c2ecf20Sopenharmony_ci		__kernel_timer_t _tid;	/* timer id */
428c2ecf20Sopenharmony_ci		int _overrun;		/* overrun count */
438c2ecf20Sopenharmony_ci		sigval_t _sigval;	/* same as below */
448c2ecf20Sopenharmony_ci		int _sys_private;       /* not to be passed to user */
458c2ecf20Sopenharmony_ci	} _timer;
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci	/* POSIX.1b signals */
488c2ecf20Sopenharmony_ci	struct {
498c2ecf20Sopenharmony_ci		__kernel_pid_t _pid;	/* sender's pid */
508c2ecf20Sopenharmony_ci		__kernel_uid32_t _uid;	/* sender's uid */
518c2ecf20Sopenharmony_ci		sigval_t _sigval;
528c2ecf20Sopenharmony_ci	} _rt;
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci	/* SIGCHLD */
558c2ecf20Sopenharmony_ci	struct {
568c2ecf20Sopenharmony_ci		__kernel_pid_t _pid;	/* which child */
578c2ecf20Sopenharmony_ci		__kernel_uid32_t _uid;	/* sender's uid */
588c2ecf20Sopenharmony_ci		int _status;		/* exit code */
598c2ecf20Sopenharmony_ci		__ARCH_SI_CLOCK_T _utime;
608c2ecf20Sopenharmony_ci		__ARCH_SI_CLOCK_T _stime;
618c2ecf20Sopenharmony_ci	} _sigchld;
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci	/* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */
648c2ecf20Sopenharmony_ci	struct {
658c2ecf20Sopenharmony_ci		void __user *_addr; /* faulting insn/memory ref. */
668c2ecf20Sopenharmony_ci#ifdef __ARCH_SI_TRAPNO
678c2ecf20Sopenharmony_ci		int _trapno;	/* TRAP # which caused the signal */
688c2ecf20Sopenharmony_ci#endif
698c2ecf20Sopenharmony_ci#ifdef __ia64__
708c2ecf20Sopenharmony_ci		int _imm;		/* immediate value for "break" */
718c2ecf20Sopenharmony_ci		unsigned int _flags;	/* see ia64 si_flags */
728c2ecf20Sopenharmony_ci		unsigned long _isr;	/* isr */
738c2ecf20Sopenharmony_ci#endif
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci#define __ADDR_BND_PKEY_PAD  (__alignof__(void *) < sizeof(short) ? \
768c2ecf20Sopenharmony_ci			      sizeof(short) : __alignof__(void *))
778c2ecf20Sopenharmony_ci		union {
788c2ecf20Sopenharmony_ci			/*
798c2ecf20Sopenharmony_ci			 * used when si_code=BUS_MCEERR_AR or
808c2ecf20Sopenharmony_ci			 * used when si_code=BUS_MCEERR_AO
818c2ecf20Sopenharmony_ci			 */
828c2ecf20Sopenharmony_ci			short _addr_lsb; /* LSB of the reported address */
838c2ecf20Sopenharmony_ci			/* used when si_code=SEGV_BNDERR */
848c2ecf20Sopenharmony_ci			struct {
858c2ecf20Sopenharmony_ci				char _dummy_bnd[__ADDR_BND_PKEY_PAD];
868c2ecf20Sopenharmony_ci				void __user *_lower;
878c2ecf20Sopenharmony_ci				void __user *_upper;
888c2ecf20Sopenharmony_ci			} _addr_bnd;
898c2ecf20Sopenharmony_ci			/* used when si_code=SEGV_PKUERR */
908c2ecf20Sopenharmony_ci			struct {
918c2ecf20Sopenharmony_ci				char _dummy_pkey[__ADDR_BND_PKEY_PAD];
928c2ecf20Sopenharmony_ci				__u32 _pkey;
938c2ecf20Sopenharmony_ci			} _addr_pkey;
948c2ecf20Sopenharmony_ci		};
958c2ecf20Sopenharmony_ci	} _sigfault;
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci	/* SIGPOLL */
988c2ecf20Sopenharmony_ci	struct {
998c2ecf20Sopenharmony_ci		__ARCH_SI_BAND_T _band;	/* POLL_IN, POLL_OUT, POLL_MSG */
1008c2ecf20Sopenharmony_ci		int _fd;
1018c2ecf20Sopenharmony_ci	} _sigpoll;
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci	/* SIGSYS */
1048c2ecf20Sopenharmony_ci	struct {
1058c2ecf20Sopenharmony_ci		void __user *_call_addr; /* calling user insn */
1068c2ecf20Sopenharmony_ci		int _syscall;	/* triggering system call number */
1078c2ecf20Sopenharmony_ci		unsigned int _arch;	/* AUDIT_ARCH_* of syscall */
1088c2ecf20Sopenharmony_ci	} _sigsys;
1098c2ecf20Sopenharmony_ci};
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci#ifndef __ARCH_HAS_SWAPPED_SIGINFO
1128c2ecf20Sopenharmony_ci#define __SIGINFO 			\
1138c2ecf20Sopenharmony_cistruct {				\
1148c2ecf20Sopenharmony_ci	int si_signo;			\
1158c2ecf20Sopenharmony_ci	int si_errno;			\
1168c2ecf20Sopenharmony_ci	int si_code;			\
1178c2ecf20Sopenharmony_ci	union __sifields _sifields;	\
1188c2ecf20Sopenharmony_ci}
1198c2ecf20Sopenharmony_ci#else
1208c2ecf20Sopenharmony_ci#define __SIGINFO 			\
1218c2ecf20Sopenharmony_cistruct {				\
1228c2ecf20Sopenharmony_ci	int si_signo;			\
1238c2ecf20Sopenharmony_ci	int si_code;			\
1248c2ecf20Sopenharmony_ci	int si_errno;			\
1258c2ecf20Sopenharmony_ci	union __sifields _sifields;	\
1268c2ecf20Sopenharmony_ci}
1278c2ecf20Sopenharmony_ci#endif /* __ARCH_HAS_SWAPPED_SIGINFO */
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_citypedef struct siginfo {
1308c2ecf20Sopenharmony_ci	union {
1318c2ecf20Sopenharmony_ci		__SIGINFO;
1328c2ecf20Sopenharmony_ci		int _si_pad[SI_MAX_SIZE/sizeof(int)];
1338c2ecf20Sopenharmony_ci	};
1348c2ecf20Sopenharmony_ci} __ARCH_SI_ATTRIBUTES siginfo_t;
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci/*
1378c2ecf20Sopenharmony_ci * How these fields are to be accessed.
1388c2ecf20Sopenharmony_ci */
1398c2ecf20Sopenharmony_ci#define si_pid		_sifields._kill._pid
1408c2ecf20Sopenharmony_ci#define si_uid		_sifields._kill._uid
1418c2ecf20Sopenharmony_ci#define si_tid		_sifields._timer._tid
1428c2ecf20Sopenharmony_ci#define si_overrun	_sifields._timer._overrun
1438c2ecf20Sopenharmony_ci#define si_sys_private  _sifields._timer._sys_private
1448c2ecf20Sopenharmony_ci#define si_status	_sifields._sigchld._status
1458c2ecf20Sopenharmony_ci#define si_utime	_sifields._sigchld._utime
1468c2ecf20Sopenharmony_ci#define si_stime	_sifields._sigchld._stime
1478c2ecf20Sopenharmony_ci#define si_value	_sifields._rt._sigval
1488c2ecf20Sopenharmony_ci#define si_int		_sifields._rt._sigval.sival_int
1498c2ecf20Sopenharmony_ci#define si_ptr		_sifields._rt._sigval.sival_ptr
1508c2ecf20Sopenharmony_ci#define si_addr		_sifields._sigfault._addr
1518c2ecf20Sopenharmony_ci#ifdef __ARCH_SI_TRAPNO
1528c2ecf20Sopenharmony_ci#define si_trapno	_sifields._sigfault._trapno
1538c2ecf20Sopenharmony_ci#endif
1548c2ecf20Sopenharmony_ci#define si_addr_lsb	_sifields._sigfault._addr_lsb
1558c2ecf20Sopenharmony_ci#define si_lower	_sifields._sigfault._addr_bnd._lower
1568c2ecf20Sopenharmony_ci#define si_upper	_sifields._sigfault._addr_bnd._upper
1578c2ecf20Sopenharmony_ci#define si_pkey		_sifields._sigfault._addr_pkey._pkey
1588c2ecf20Sopenharmony_ci#define si_band		_sifields._sigpoll._band
1598c2ecf20Sopenharmony_ci#define si_fd		_sifields._sigpoll._fd
1608c2ecf20Sopenharmony_ci#define si_call_addr	_sifields._sigsys._call_addr
1618c2ecf20Sopenharmony_ci#define si_syscall	_sifields._sigsys._syscall
1628c2ecf20Sopenharmony_ci#define si_arch		_sifields._sigsys._arch
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ci/*
1658c2ecf20Sopenharmony_ci * si_code values
1668c2ecf20Sopenharmony_ci * Digital reserves positive values for kernel-generated signals.
1678c2ecf20Sopenharmony_ci */
1688c2ecf20Sopenharmony_ci#define SI_USER		0		/* sent by kill, sigsend, raise */
1698c2ecf20Sopenharmony_ci#define SI_KERNEL	0x80		/* sent by the kernel from somewhere */
1708c2ecf20Sopenharmony_ci#define SI_QUEUE	-1		/* sent by sigqueue */
1718c2ecf20Sopenharmony_ci#define SI_TIMER	-2		/* sent by timer expiration */
1728c2ecf20Sopenharmony_ci#define SI_MESGQ	-3		/* sent by real time mesq state change */
1738c2ecf20Sopenharmony_ci#define SI_ASYNCIO	-4		/* sent by AIO completion */
1748c2ecf20Sopenharmony_ci#define SI_SIGIO	-5		/* sent by queued SIGIO */
1758c2ecf20Sopenharmony_ci#define SI_TKILL	-6		/* sent by tkill system call */
1768c2ecf20Sopenharmony_ci#define SI_DETHREAD	-7		/* sent by execve() killing subsidiary threads */
1778c2ecf20Sopenharmony_ci#define SI_ASYNCNL	-60		/* sent by glibc async name lookup completion */
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_ci#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0)
1808c2ecf20Sopenharmony_ci#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0)
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci/*
1838c2ecf20Sopenharmony_ci * SIGILL si_codes
1848c2ecf20Sopenharmony_ci */
1858c2ecf20Sopenharmony_ci#define ILL_ILLOPC	1	/* illegal opcode */
1868c2ecf20Sopenharmony_ci#define ILL_ILLOPN	2	/* illegal operand */
1878c2ecf20Sopenharmony_ci#define ILL_ILLADR	3	/* illegal addressing mode */
1888c2ecf20Sopenharmony_ci#define ILL_ILLTRP	4	/* illegal trap */
1898c2ecf20Sopenharmony_ci#define ILL_PRVOPC	5	/* privileged opcode */
1908c2ecf20Sopenharmony_ci#define ILL_PRVREG	6	/* privileged register */
1918c2ecf20Sopenharmony_ci#define ILL_COPROC	7	/* coprocessor error */
1928c2ecf20Sopenharmony_ci#define ILL_BADSTK	8	/* internal stack error */
1938c2ecf20Sopenharmony_ci#define ILL_BADIADDR	9	/* unimplemented instruction address */
1948c2ecf20Sopenharmony_ci#define __ILL_BREAK	10	/* illegal break */
1958c2ecf20Sopenharmony_ci#define __ILL_BNDMOD	11	/* bundle-update (modification) in progress */
1968c2ecf20Sopenharmony_ci#define NSIGILL		11
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ci/*
1998c2ecf20Sopenharmony_ci * SIGFPE si_codes
2008c2ecf20Sopenharmony_ci */
2018c2ecf20Sopenharmony_ci#define FPE_INTDIV	1	/* integer divide by zero */
2028c2ecf20Sopenharmony_ci#define FPE_INTOVF	2	/* integer overflow */
2038c2ecf20Sopenharmony_ci#define FPE_FLTDIV	3	/* floating point divide by zero */
2048c2ecf20Sopenharmony_ci#define FPE_FLTOVF	4	/* floating point overflow */
2058c2ecf20Sopenharmony_ci#define FPE_FLTUND	5	/* floating point underflow */
2068c2ecf20Sopenharmony_ci#define FPE_FLTRES	6	/* floating point inexact result */
2078c2ecf20Sopenharmony_ci#define FPE_FLTINV	7	/* floating point invalid operation */
2088c2ecf20Sopenharmony_ci#define FPE_FLTSUB	8	/* subscript out of range */
2098c2ecf20Sopenharmony_ci#define __FPE_DECOVF	9	/* decimal overflow */
2108c2ecf20Sopenharmony_ci#define __FPE_DECDIV	10	/* decimal division by zero */
2118c2ecf20Sopenharmony_ci#define __FPE_DECERR	11	/* packed decimal error */
2128c2ecf20Sopenharmony_ci#define __FPE_INVASC	12	/* invalid ASCII digit */
2138c2ecf20Sopenharmony_ci#define __FPE_INVDEC	13	/* invalid decimal digit */
2148c2ecf20Sopenharmony_ci#define FPE_FLTUNK	14	/* undiagnosed floating-point exception */
2158c2ecf20Sopenharmony_ci#define FPE_CONDTRAP	15	/* trap on condition */
2168c2ecf20Sopenharmony_ci#define NSIGFPE		15
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci/*
2198c2ecf20Sopenharmony_ci * SIGSEGV si_codes
2208c2ecf20Sopenharmony_ci */
2218c2ecf20Sopenharmony_ci#define SEGV_MAPERR	1	/* address not mapped to object */
2228c2ecf20Sopenharmony_ci#define SEGV_ACCERR	2	/* invalid permissions for mapped object */
2238c2ecf20Sopenharmony_ci#define SEGV_BNDERR	3	/* failed address bound checks */
2248c2ecf20Sopenharmony_ci#ifdef __ia64__
2258c2ecf20Sopenharmony_ci# define __SEGV_PSTKOVF	4	/* paragraph stack overflow */
2268c2ecf20Sopenharmony_ci#else
2278c2ecf20Sopenharmony_ci# define SEGV_PKUERR	4	/* failed protection key checks */
2288c2ecf20Sopenharmony_ci#endif
2298c2ecf20Sopenharmony_ci#define SEGV_ACCADI	5	/* ADI not enabled for mapped object */
2308c2ecf20Sopenharmony_ci#define SEGV_ADIDERR	6	/* Disrupting MCD error */
2318c2ecf20Sopenharmony_ci#define SEGV_ADIPERR	7	/* Precise MCD exception */
2328c2ecf20Sopenharmony_ci#define SEGV_MTEAERR	8	/* Asynchronous ARM MTE error */
2338c2ecf20Sopenharmony_ci#define SEGV_MTESERR	9	/* Synchronous ARM MTE exception */
2348c2ecf20Sopenharmony_ci#define NSIGSEGV	9
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci/*
2378c2ecf20Sopenharmony_ci * SIGBUS si_codes
2388c2ecf20Sopenharmony_ci */
2398c2ecf20Sopenharmony_ci#define BUS_ADRALN	1	/* invalid address alignment */
2408c2ecf20Sopenharmony_ci#define BUS_ADRERR	2	/* non-existent physical address */
2418c2ecf20Sopenharmony_ci#define BUS_OBJERR	3	/* object specific hardware error */
2428c2ecf20Sopenharmony_ci/* hardware memory error consumed on a machine check: action required */
2438c2ecf20Sopenharmony_ci#define BUS_MCEERR_AR	4
2448c2ecf20Sopenharmony_ci/* hardware memory error detected in process but not consumed: action optional*/
2458c2ecf20Sopenharmony_ci#define BUS_MCEERR_AO	5
2468c2ecf20Sopenharmony_ci#define NSIGBUS		5
2478c2ecf20Sopenharmony_ci
2488c2ecf20Sopenharmony_ci/*
2498c2ecf20Sopenharmony_ci * SIGTRAP si_codes
2508c2ecf20Sopenharmony_ci */
2518c2ecf20Sopenharmony_ci#define TRAP_BRKPT	1	/* process breakpoint */
2528c2ecf20Sopenharmony_ci#define TRAP_TRACE	2	/* process trace trap */
2538c2ecf20Sopenharmony_ci#define TRAP_BRANCH     3	/* process taken branch trap */
2548c2ecf20Sopenharmony_ci#define TRAP_HWBKPT     4	/* hardware breakpoint/watchpoint */
2558c2ecf20Sopenharmony_ci#define TRAP_UNK	5	/* undiagnosed trap */
2568c2ecf20Sopenharmony_ci#define NSIGTRAP	5
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_ci/*
2598c2ecf20Sopenharmony_ci * There is an additional set of SIGTRAP si_codes used by ptrace
2608c2ecf20Sopenharmony_ci * that are of the form: ((PTRACE_EVENT_XXX << 8) | SIGTRAP)
2618c2ecf20Sopenharmony_ci */
2628c2ecf20Sopenharmony_ci
2638c2ecf20Sopenharmony_ci/*
2648c2ecf20Sopenharmony_ci * SIGCHLD si_codes
2658c2ecf20Sopenharmony_ci */
2668c2ecf20Sopenharmony_ci#define CLD_EXITED	1	/* child has exited */
2678c2ecf20Sopenharmony_ci#define CLD_KILLED	2	/* child was killed */
2688c2ecf20Sopenharmony_ci#define CLD_DUMPED	3	/* child terminated abnormally */
2698c2ecf20Sopenharmony_ci#define CLD_TRAPPED	4	/* traced child has trapped */
2708c2ecf20Sopenharmony_ci#define CLD_STOPPED	5	/* child has stopped */
2718c2ecf20Sopenharmony_ci#define CLD_CONTINUED	6	/* stopped child has continued */
2728c2ecf20Sopenharmony_ci#define NSIGCHLD	6
2738c2ecf20Sopenharmony_ci
2748c2ecf20Sopenharmony_ci/*
2758c2ecf20Sopenharmony_ci * SIGPOLL (or any other signal without signal specific si_codes) si_codes
2768c2ecf20Sopenharmony_ci */
2778c2ecf20Sopenharmony_ci#define POLL_IN		1	/* data input available */
2788c2ecf20Sopenharmony_ci#define POLL_OUT	2	/* output buffers available */
2798c2ecf20Sopenharmony_ci#define POLL_MSG	3	/* input message available */
2808c2ecf20Sopenharmony_ci#define POLL_ERR	4	/* i/o error */
2818c2ecf20Sopenharmony_ci#define POLL_PRI	5	/* high priority input available */
2828c2ecf20Sopenharmony_ci#define POLL_HUP	6	/* device disconnected */
2838c2ecf20Sopenharmony_ci#define NSIGPOLL	6
2848c2ecf20Sopenharmony_ci
2858c2ecf20Sopenharmony_ci/*
2868c2ecf20Sopenharmony_ci * SIGSYS si_codes
2878c2ecf20Sopenharmony_ci */
2888c2ecf20Sopenharmony_ci#define SYS_SECCOMP	1	/* seccomp triggered */
2898c2ecf20Sopenharmony_ci#define NSIGSYS		1
2908c2ecf20Sopenharmony_ci
2918c2ecf20Sopenharmony_ci/*
2928c2ecf20Sopenharmony_ci * SIGEMT si_codes
2938c2ecf20Sopenharmony_ci */
2948c2ecf20Sopenharmony_ci#define EMT_TAGOVF	1	/* tag overflow */
2958c2ecf20Sopenharmony_ci#define NSIGEMT		1
2968c2ecf20Sopenharmony_ci
2978c2ecf20Sopenharmony_ci/*
2988c2ecf20Sopenharmony_ci * sigevent definitions
2998c2ecf20Sopenharmony_ci *
3008c2ecf20Sopenharmony_ci * It seems likely that SIGEV_THREAD will have to be handled from
3018c2ecf20Sopenharmony_ci * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
3028c2ecf20Sopenharmony_ci * thread manager then catches and does the appropriate nonsense.
3038c2ecf20Sopenharmony_ci * However, everything is written out here so as to not get lost.
3048c2ecf20Sopenharmony_ci */
3058c2ecf20Sopenharmony_ci#define SIGEV_SIGNAL	0	/* notify via signal */
3068c2ecf20Sopenharmony_ci#define SIGEV_NONE	1	/* other notification: meaningless */
3078c2ecf20Sopenharmony_ci#define SIGEV_THREAD	2	/* deliver via thread creation */
3088c2ecf20Sopenharmony_ci#define SIGEV_THREAD_ID 4	/* deliver to thread */
3098c2ecf20Sopenharmony_ci
3108c2ecf20Sopenharmony_ci/*
3118c2ecf20Sopenharmony_ci * This works because the alignment is ok on all current architectures
3128c2ecf20Sopenharmony_ci * but we leave open this being overridden in the future
3138c2ecf20Sopenharmony_ci */
3148c2ecf20Sopenharmony_ci#ifndef __ARCH_SIGEV_PREAMBLE_SIZE
3158c2ecf20Sopenharmony_ci#define __ARCH_SIGEV_PREAMBLE_SIZE	(sizeof(int) * 2 + sizeof(sigval_t))
3168c2ecf20Sopenharmony_ci#endif
3178c2ecf20Sopenharmony_ci
3188c2ecf20Sopenharmony_ci#define SIGEV_MAX_SIZE	64
3198c2ecf20Sopenharmony_ci#define SIGEV_PAD_SIZE	((SIGEV_MAX_SIZE - __ARCH_SIGEV_PREAMBLE_SIZE) \
3208c2ecf20Sopenharmony_ci		/ sizeof(int))
3218c2ecf20Sopenharmony_ci
3228c2ecf20Sopenharmony_citypedef struct sigevent {
3238c2ecf20Sopenharmony_ci	sigval_t sigev_value;
3248c2ecf20Sopenharmony_ci	int sigev_signo;
3258c2ecf20Sopenharmony_ci	int sigev_notify;
3268c2ecf20Sopenharmony_ci	union {
3278c2ecf20Sopenharmony_ci		int _pad[SIGEV_PAD_SIZE];
3288c2ecf20Sopenharmony_ci		 int _tid;
3298c2ecf20Sopenharmony_ci
3308c2ecf20Sopenharmony_ci		struct {
3318c2ecf20Sopenharmony_ci			void (*_function)(sigval_t);
3328c2ecf20Sopenharmony_ci			void *_attribute;	/* really pthread_attr_t */
3338c2ecf20Sopenharmony_ci		} _sigev_thread;
3348c2ecf20Sopenharmony_ci	} _sigev_un;
3358c2ecf20Sopenharmony_ci} sigevent_t;
3368c2ecf20Sopenharmony_ci
3378c2ecf20Sopenharmony_ci#define sigev_notify_function	_sigev_un._sigev_thread._function
3388c2ecf20Sopenharmony_ci#define sigev_notify_attributes	_sigev_un._sigev_thread._attribute
3398c2ecf20Sopenharmony_ci#define sigev_notify_thread_id	 _sigev_un._tid
3408c2ecf20Sopenharmony_ci
3418c2ecf20Sopenharmony_ci
3428c2ecf20Sopenharmony_ci#endif /* _UAPI_ASM_GENERIC_SIGINFO_H */
343