16f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28a1ab315SDavid Howells #ifndef _UAPI_ASM_GENERIC_SIGINFO_H
38a1ab315SDavid Howells #define _UAPI_ASM_GENERIC_SIGINFO_H
48a1ab315SDavid Howells 
58a1ab315SDavid Howells #include <linux/compiler.h>
68a1ab315SDavid Howells #include <linux/types.h>
78a1ab315SDavid Howells 
88a1ab315SDavid Howells typedef union sigval {
98a1ab315SDavid Howells 	int sival_int;
108a1ab315SDavid Howells 	void __user *sival_ptr;
118a1ab315SDavid Howells } sigval_t;
128a1ab315SDavid Howells 
138a1ab315SDavid Howells #define SI_MAX_SIZE	128
148a1ab315SDavid Howells 
158a1ab315SDavid Howells /*
168a1ab315SDavid Howells  * The default "si_band" type is "long", as specified by POSIX.
178a1ab315SDavid Howells  * However, some architectures want to override this to "int"
188a1ab315SDavid Howells  * for historical compatibility reasons, so we allow that.
198a1ab315SDavid Howells  */
208a1ab315SDavid Howells #ifndef __ARCH_SI_BAND_T
218a1ab315SDavid Howells #define __ARCH_SI_BAND_T long
228a1ab315SDavid Howells #endif
238a1ab315SDavid Howells 
248a1ab315SDavid Howells #ifndef __ARCH_SI_CLOCK_T
258a1ab315SDavid Howells #define __ARCH_SI_CLOCK_T __kernel_clock_t
268a1ab315SDavid Howells #endif
278a1ab315SDavid Howells 
288a1ab315SDavid Howells #ifndef __ARCH_SI_ATTRIBUTES
298a1ab315SDavid Howells #define __ARCH_SI_ATTRIBUTES
308a1ab315SDavid Howells #endif
318a1ab315SDavid Howells 
3250ae8130SEric W. Biederman /*
3350ae8130SEric W. Biederman  * Be careful when extending this union.  On 32bit siginfo_t is 32bit
3450ae8130SEric W. Biederman  * aligned.  Which means that a 64bit field or any other field that
3550ae8130SEric W. Biederman  * would increase the alignment of siginfo_t will break the ABI.
3650ae8130SEric W. Biederman  */
37f2838018SEric W. Biederman union __sifields {
388a1ab315SDavid Howells 	/* kill() */
398a1ab315SDavid Howells 	struct {
408a1ab315SDavid Howells 		__kernel_pid_t _pid;	/* sender's pid */
414795477bSAl Viro 		__kernel_uid32_t _uid;	/* sender's uid */
428a1ab315SDavid Howells 	} _kill;
438a1ab315SDavid Howells 
448a1ab315SDavid Howells 	/* POSIX.1b timers */
458a1ab315SDavid Howells 	struct {
468a1ab315SDavid Howells 		__kernel_timer_t _tid;	/* timer id */
478a1ab315SDavid Howells 		int _overrun;		/* overrun count */
488a1ab315SDavid Howells 		sigval_t _sigval;	/* same as below */
498a1ab315SDavid Howells 		int _sys_private;       /* not to be passed to user */
508a1ab315SDavid Howells 	} _timer;
518a1ab315SDavid Howells 
528a1ab315SDavid Howells 	/* POSIX.1b signals */
538a1ab315SDavid Howells 	struct {
548a1ab315SDavid Howells 		__kernel_pid_t _pid;	/* sender's pid */
554795477bSAl Viro 		__kernel_uid32_t _uid;	/* sender's uid */
568a1ab315SDavid Howells 		sigval_t _sigval;
578a1ab315SDavid Howells 	} _rt;
588a1ab315SDavid Howells 
598a1ab315SDavid Howells 	/* SIGCHLD */
608a1ab315SDavid Howells 	struct {
618a1ab315SDavid Howells 		__kernel_pid_t _pid;	/* which child */
624795477bSAl Viro 		__kernel_uid32_t _uid;	/* sender's uid */
638a1ab315SDavid Howells 		int _status;		/* exit code */
648a1ab315SDavid Howells 		__ARCH_SI_CLOCK_T _utime;
658a1ab315SDavid Howells 		__ARCH_SI_CLOCK_T _stime;
668a1ab315SDavid Howells 	} _sigchld;
678a1ab315SDavid Howells 
68deaf19c0SEric W. Biederman 	/* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */
698a1ab315SDavid Howells 	struct {
708a1ab315SDavid Howells 		void __user *_addr; /* faulting insn/memory ref. */
712eb50e2eSEric W. Biederman #ifdef __ia64__
722eb50e2eSEric W. Biederman 		int _imm;		/* immediate value for "break" */
732eb50e2eSEric W. Biederman 		unsigned int _flags;	/* see ia64 si_flags */
742eb50e2eSEric W. Biederman 		unsigned long _isr;	/* isr */
752eb50e2eSEric W. Biederman #endif
768420f719SEric W. Biederman 
778420f719SEric W. Biederman #define __ADDR_BND_PKEY_PAD  (__alignof__(void *) < sizeof(short) ? \
788420f719SEric W. Biederman 			      sizeof(short) : __alignof__(void *))
79cd0ea35fSDave Hansen 		union {
80add0b32eSEric W. Biederman 			/* used on alpha and sparc */
81add0b32eSEric W. Biederman 			int _trapno;	/* TRAP # which caused the signal */
82b68a68d3SEric W. Biederman 			/*
83b68a68d3SEric W. Biederman 			 * used when si_code=BUS_MCEERR_AR or
84b68a68d3SEric W. Biederman 			 * used when si_code=BUS_MCEERR_AO
85b68a68d3SEric W. Biederman 			 */
86b68a68d3SEric W. Biederman 			short _addr_lsb; /* LSB of the reported address */
87cd0ea35fSDave Hansen 			/* used when si_code=SEGV_BNDERR */
88ee1b58d3SQiaowei Ren 			struct {
898420f719SEric W. Biederman 				char _dummy_bnd[__ADDR_BND_PKEY_PAD];
90ee1b58d3SQiaowei Ren 				void __user *_lower;
91ee1b58d3SQiaowei Ren 				void __user *_upper;
92ee1b58d3SQiaowei Ren 			} _addr_bnd;
93cd0ea35fSDave Hansen 			/* used when si_code=SEGV_PKUERR */
94b68a68d3SEric W. Biederman 			struct {
958420f719SEric W. Biederman 				char _dummy_pkey[__ADDR_BND_PKEY_PAD];
9649cd53bfSDave Hansen 				__u32 _pkey;
97b68a68d3SEric W. Biederman 			} _addr_pkey;
98fb6cc127SMarco Elver 			/* used when si_code=TRAP_PERF */
990683b531SEric W. Biederman 			struct {
1000683b531SEric W. Biederman 				unsigned long _data;
1010683b531SEric W. Biederman 				__u32 _type;
10278ed93d7SMarco Elver 				__u32 _flags;
1030683b531SEric W. Biederman 			} _perf;
104cd0ea35fSDave Hansen 		};
1058a1ab315SDavid Howells 	} _sigfault;
1068a1ab315SDavid Howells 
1078a1ab315SDavid Howells 	/* SIGPOLL */
1088a1ab315SDavid Howells 	struct {
1098a1ab315SDavid Howells 		__ARCH_SI_BAND_T _band;	/* POLL_IN, POLL_OUT, POLL_MSG */
1108a1ab315SDavid Howells 		int _fd;
1118a1ab315SDavid Howells 	} _sigpoll;
1128a1ab315SDavid Howells 
1138a1ab315SDavid Howells 	/* SIGSYS */
1148a1ab315SDavid Howells 	struct {
1158a1ab315SDavid Howells 		void __user *_call_addr; /* calling user insn */
1168a1ab315SDavid Howells 		int _syscall;	/* triggering system call number */
1178a1ab315SDavid Howells 		unsigned int _arch;	/* AUDIT_ARCH_* of syscall */
1188a1ab315SDavid Howells 	} _sigsys;
119f2838018SEric W. Biederman };
120f2838018SEric W. Biederman 
121f2838018SEric W. Biederman #ifndef __ARCH_HAS_SWAPPED_SIGINFO
122f2838018SEric W. Biederman #define __SIGINFO 			\
123f2838018SEric W. Biederman struct {				\
124f2838018SEric W. Biederman 	int si_signo;			\
125f2838018SEric W. Biederman 	int si_errno;			\
126f2838018SEric W. Biederman 	int si_code;			\
127f2838018SEric W. Biederman 	union __sifields _sifields;	\
128f2838018SEric W. Biederman }
129f2838018SEric W. Biederman #else
130f2838018SEric W. Biederman #define __SIGINFO 			\
131f2838018SEric W. Biederman struct {				\
132f2838018SEric W. Biederman 	int si_signo;			\
133f2838018SEric W. Biederman 	int si_code;			\
134f2838018SEric W. Biederman 	int si_errno;			\
135f2838018SEric W. Biederman 	union __sifields _sifields;	\
136f2838018SEric W. Biederman }
137f2838018SEric W. Biederman #endif /* __ARCH_HAS_SWAPPED_SIGINFO */
138f2838018SEric W. Biederman 
139f2838018SEric W. Biederman typedef struct siginfo {
140f2838018SEric W. Biederman 	union {
141f2838018SEric W. Biederman 		__SIGINFO;
142f2838018SEric W. Biederman 		int _si_pad[SI_MAX_SIZE/sizeof(int)];
143f2838018SEric W. Biederman 	};
1448a1ab315SDavid Howells } __ARCH_SI_ATTRIBUTES siginfo_t;
1458a1ab315SDavid Howells 
1468a1ab315SDavid Howells /*
1478a1ab315SDavid Howells  * How these fields are to be accessed.
1488a1ab315SDavid Howells  */
1498a1ab315SDavid Howells #define si_pid		_sifields._kill._pid
1508a1ab315SDavid Howells #define si_uid		_sifields._kill._uid
1518a1ab315SDavid Howells #define si_tid		_sifields._timer._tid
1528a1ab315SDavid Howells #define si_overrun	_sifields._timer._overrun
1538a1ab315SDavid Howells #define si_sys_private  _sifields._timer._sys_private
1548a1ab315SDavid Howells #define si_status	_sifields._sigchld._status
1558a1ab315SDavid Howells #define si_utime	_sifields._sigchld._utime
1568a1ab315SDavid Howells #define si_stime	_sifields._sigchld._stime
1578a1ab315SDavid Howells #define si_value	_sifields._rt._sigval
1588a1ab315SDavid Howells #define si_int		_sifields._rt._sigval.sival_int
1598a1ab315SDavid Howells #define si_ptr		_sifields._rt._sigval.sival_ptr
1608a1ab315SDavid Howells #define si_addr		_sifields._sigfault._addr
1618a1ab315SDavid Howells #define si_trapno	_sifields._sigfault._trapno
1628a1ab315SDavid Howells #define si_addr_lsb	_sifields._sigfault._addr_lsb
163ee1b58d3SQiaowei Ren #define si_lower	_sifields._sigfault._addr_bnd._lower
164ee1b58d3SQiaowei Ren #define si_upper	_sifields._sigfault._addr_bnd._upper
165b68a68d3SEric W. Biederman #define si_pkey		_sifields._sigfault._addr_pkey._pkey
1660683b531SEric W. Biederman #define si_perf_data	_sifields._sigfault._perf._data
1670683b531SEric W. Biederman #define si_perf_type	_sifields._sigfault._perf._type
16878ed93d7SMarco Elver #define si_perf_flags	_sifields._sigfault._perf._flags
1698a1ab315SDavid Howells #define si_band		_sifields._sigpoll._band
1708a1ab315SDavid Howells #define si_fd		_sifields._sigpoll._fd
1718a1ab315SDavid Howells #define si_call_addr	_sifields._sigsys._call_addr
1728a1ab315SDavid Howells #define si_syscall	_sifields._sigsys._syscall
1738a1ab315SDavid Howells #define si_arch		_sifields._sigsys._arch
1748a1ab315SDavid Howells 
1758a1ab315SDavid Howells /*
1768a1ab315SDavid Howells  * si_code values
1778a1ab315SDavid Howells  * Digital reserves positive values for kernel-generated signals.
1788a1ab315SDavid Howells  */
1798a1ab315SDavid Howells #define SI_USER		0		/* sent by kill, sigsend, raise */
1808a1ab315SDavid Howells #define SI_KERNEL	0x80		/* sent by the kernel from somewhere */
1818a1ab315SDavid Howells #define SI_QUEUE	-1		/* sent by sigqueue */
182cc731525SEric W. Biederman #define SI_TIMER	-2		/* sent by timer expiration */
183cc731525SEric W. Biederman #define SI_MESGQ	-3		/* sent by real time mesq state change */
1848a1ab315SDavid Howells #define SI_ASYNCIO	-4		/* sent by AIO completion */
185cc731525SEric W. Biederman #define SI_SIGIO	-5		/* sent by queued SIGIO */
1868a1ab315SDavid Howells #define SI_TKILL	-6		/* sent by tkill system call */
1878a1ab315SDavid Howells #define SI_DETHREAD	-7		/* sent by execve() killing subsidiary threads */
18875c0abb8SEric W. Biederman #define SI_ASYNCNL	-60		/* sent by glibc async name lookup completion */
1898a1ab315SDavid Howells 
1908a1ab315SDavid Howells #define SI_FROMUSER(siptr)	((siptr)->si_code <= 0)
1918a1ab315SDavid Howells #define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0)
1928a1ab315SDavid Howells 
1938a1ab315SDavid Howells /*
1948a1ab315SDavid Howells  * SIGILL si_codes
1958a1ab315SDavid Howells  */
196cc731525SEric W. Biederman #define ILL_ILLOPC	1	/* illegal opcode */
197cc731525SEric W. Biederman #define ILL_ILLOPN	2	/* illegal operand */
198cc731525SEric W. Biederman #define ILL_ILLADR	3	/* illegal addressing mode */
199cc731525SEric W. Biederman #define ILL_ILLTRP	4	/* illegal trap */
200cc731525SEric W. Biederman #define ILL_PRVOPC	5	/* privileged opcode */
201cc731525SEric W. Biederman #define ILL_PRVREG	6	/* privileged register */
202cc731525SEric W. Biederman #define ILL_COPROC	7	/* coprocessor error */
203cc731525SEric W. Biederman #define ILL_BADSTK	8	/* internal stack error */
204ac54058dSEric W. Biederman #define ILL_BADIADDR	9	/* unimplemented instruction address */
205ac54058dSEric W. Biederman #define __ILL_BREAK	10	/* illegal break */
206ac54058dSEric W. Biederman #define __ILL_BNDMOD	11	/* bundle-update (modification) in progress */
207ac54058dSEric W. Biederman #define NSIGILL		11
2088a1ab315SDavid Howells 
2098a1ab315SDavid Howells /*
2108a1ab315SDavid Howells  * SIGFPE si_codes
2118a1ab315SDavid Howells  */
212cc731525SEric W. Biederman #define FPE_INTDIV	1	/* integer divide by zero */
213cc731525SEric W. Biederman #define FPE_INTOVF	2	/* integer overflow */
214cc731525SEric W. Biederman #define FPE_FLTDIV	3	/* floating point divide by zero */
215cc731525SEric W. Biederman #define FPE_FLTOVF	4	/* floating point overflow */
216cc731525SEric W. Biederman #define FPE_FLTUND	5	/* floating point underflow */
217cc731525SEric W. Biederman #define FPE_FLTRES	6	/* floating point inexact result */
218cc731525SEric W. Biederman #define FPE_FLTINV	7	/* floating point invalid operation */
219cc731525SEric W. Biederman #define FPE_FLTSUB	8	/* subscript out of range */
220ac54058dSEric W. Biederman #define __FPE_DECOVF	9	/* decimal overflow */
221ac54058dSEric W. Biederman #define __FPE_DECDIV	10	/* decimal division by zero */
222ac54058dSEric W. Biederman #define __FPE_DECERR	11	/* packed decimal error */
223ac54058dSEric W. Biederman #define __FPE_INVASC	12	/* invalid ASCII digit */
224ac54058dSEric W. Biederman #define __FPE_INVDEC	13	/* invalid decimal digit */
225266da65eSDave Martin #define FPE_FLTUNK	14	/* undiagnosed floating-point exception */
22675abf642SHelge Deller #define FPE_CONDTRAP	15	/* trap on condition */
22775abf642SHelge Deller #define NSIGFPE		15
2288a1ab315SDavid Howells 
2298a1ab315SDavid Howells /*
2308a1ab315SDavid Howells  * SIGSEGV si_codes
2318a1ab315SDavid Howells  */
232cc731525SEric W. Biederman #define SEGV_MAPERR	1	/* address not mapped to object */
233cc731525SEric W. Biederman #define SEGV_ACCERR	2	/* invalid permissions for mapped object */
234cc731525SEric W. Biederman #define SEGV_BNDERR	3	/* failed address bound checks */
235ac54058dSEric W. Biederman #ifdef __ia64__
236ac54058dSEric W. Biederman # define __SEGV_PSTKOVF	4	/* paragraph stack overflow */
237ac54058dSEric W. Biederman #else
238cc731525SEric W. Biederman # define SEGV_PKUERR	4	/* failed protection key checks */
239ac54058dSEric W. Biederman #endif
240d84bb709SKhalid Aziz #define SEGV_ACCADI	5	/* ADI not enabled for mapped object */
241d84bb709SKhalid Aziz #define SEGV_ADIDERR	6	/* Disrupting MCD error */
242d84bb709SKhalid Aziz #define SEGV_ADIPERR	7	/* Precise MCD exception */
24374f10824SVincenzo Frascino #define SEGV_MTEAERR	8	/* Asynchronous ARM MTE error */
24474f10824SVincenzo Frascino #define SEGV_MTESERR	9	/* Synchronous ARM MTE exception */
245*a5f6c2acSRick Edgecombe #define SEGV_CPERR	10	/* Control protection fault */
246*a5f6c2acSRick Edgecombe #define NSIGSEGV	10
2478a1ab315SDavid Howells 
2488a1ab315SDavid Howells /*
2498a1ab315SDavid Howells  * SIGBUS si_codes
2508a1ab315SDavid Howells  */
251cc731525SEric W. Biederman #define BUS_ADRALN	1	/* invalid address alignment */
252cc731525SEric W. Biederman #define BUS_ADRERR	2	/* non-existent physical address */
253cc731525SEric W. Biederman #define BUS_OBJERR	3	/* object specific hardware error */
2548a1ab315SDavid Howells /* hardware memory error consumed on a machine check: action required */
255cc731525SEric W. Biederman #define BUS_MCEERR_AR	4
2568a1ab315SDavid Howells /* hardware memory error detected in process but not consumed: action optional*/
257cc731525SEric W. Biederman #define BUS_MCEERR_AO	5
2588a1ab315SDavid Howells #define NSIGBUS		5
2598a1ab315SDavid Howells 
2608a1ab315SDavid Howells /*
2618a1ab315SDavid Howells  * SIGTRAP si_codes
2628a1ab315SDavid Howells  */
263cc731525SEric W. Biederman #define TRAP_BRKPT	1	/* process breakpoint */
264cc731525SEric W. Biederman #define TRAP_TRACE	2	/* process trace trap */
265cc731525SEric W. Biederman #define TRAP_BRANCH     3	/* process taken branch trap */
266cc731525SEric W. Biederman #define TRAP_HWBKPT     4	/* hardware breakpoint/watchpoint */
267db78e6a0SEric W. Biederman #define TRAP_UNK	5	/* undiagnosed trap */
268fb6cc127SMarco Elver #define TRAP_PERF	6	/* perf event with sigtrap=1 */
269fb6cc127SMarco Elver #define NSIGTRAP	6
2708a1ab315SDavid Howells 
2718a1ab315SDavid Howells /*
27263300eddSRandy Dunlap  * There is an additional set of SIGTRAP si_codes used by ptrace
27363300eddSRandy Dunlap  * that are of the form: ((PTRACE_EVENT_XXX << 8) | SIGTRAP)
274f9886bc5SEric W. Biederman  */
275f9886bc5SEric W. Biederman 
276f9886bc5SEric W. Biederman /*
27778ed93d7SMarco Elver  * Flags for si_perf_flags if SIGTRAP si_code is TRAP_PERF.
27878ed93d7SMarco Elver  */
27978ed93d7SMarco Elver #define TRAP_PERF_FLAG_ASYNC (1u << 0)
28078ed93d7SMarco Elver 
28178ed93d7SMarco Elver /*
2828a1ab315SDavid Howells  * SIGCHLD si_codes
2838a1ab315SDavid Howells  */
284cc731525SEric W. Biederman #define CLD_EXITED	1	/* child has exited */
285cc731525SEric W. Biederman #define CLD_KILLED	2	/* child was killed */
286cc731525SEric W. Biederman #define CLD_DUMPED	3	/* child terminated abnormally */
287cc731525SEric W. Biederman #define CLD_TRAPPED	4	/* traced child has trapped */
288cc731525SEric W. Biederman #define CLD_STOPPED	5	/* child has stopped */
289cc731525SEric W. Biederman #define CLD_CONTINUED	6	/* stopped child has continued */
2908a1ab315SDavid Howells #define NSIGCHLD	6
2918a1ab315SDavid Howells 
2928a1ab315SDavid Howells /*
293d08477aaSEric W. Biederman  * SIGPOLL (or any other signal without signal specific si_codes) si_codes
2948a1ab315SDavid Howells  */
295cc731525SEric W. Biederman #define POLL_IN		1	/* data input available */
296cc731525SEric W. Biederman #define POLL_OUT	2	/* output buffers available */
297cc731525SEric W. Biederman #define POLL_MSG	3	/* input message available */
298cc731525SEric W. Biederman #define POLL_ERR	4	/* i/o error */
299cc731525SEric W. Biederman #define POLL_PRI	5	/* high priority input available */
300cc731525SEric W. Biederman #define POLL_HUP	6	/* device disconnected */
3018a1ab315SDavid Howells #define NSIGPOLL	6
3028a1ab315SDavid Howells 
3038a1ab315SDavid Howells /*
3048a1ab315SDavid Howells  * SIGSYS si_codes
3058a1ab315SDavid Howells  */
306cc731525SEric W. Biederman #define SYS_SECCOMP	1	/* seccomp triggered */
3071d7637d8SGabriel Krisman Bertazi #define SYS_USER_DISPATCH 2	/* syscall user dispatch triggered */
3081d7637d8SGabriel Krisman Bertazi #define NSIGSYS		2
3098a1ab315SDavid Howells 
3108a1ab315SDavid Howells /*
311018303a9SEric W. Biederman  * SIGEMT si_codes
312018303a9SEric W. Biederman  */
313018303a9SEric W. Biederman #define EMT_TAGOVF	1	/* tag overflow */
314018303a9SEric W. Biederman #define NSIGEMT		1
315018303a9SEric W. Biederman 
316018303a9SEric W. Biederman /*
3178a1ab315SDavid Howells  * sigevent definitions
3188a1ab315SDavid Howells  *
3198a1ab315SDavid Howells  * It seems likely that SIGEV_THREAD will have to be handled from
3208a1ab315SDavid Howells  * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
3218a1ab315SDavid Howells  * thread manager then catches and does the appropriate nonsense.
3228a1ab315SDavid Howells  * However, everything is written out here so as to not get lost.
3238a1ab315SDavid Howells  */
3248a1ab315SDavid Howells #define SIGEV_SIGNAL	0	/* notify via signal */
3258a1ab315SDavid Howells #define SIGEV_NONE	1	/* other notification: meaningless */
3268a1ab315SDavid Howells #define SIGEV_THREAD	2	/* deliver via thread creation */
3278a1ab315SDavid Howells #define SIGEV_THREAD_ID 4	/* deliver to thread */
3288a1ab315SDavid Howells 
3298a1ab315SDavid Howells /*
3308a1ab315SDavid Howells  * This works because the alignment is ok on all current architectures
3318a1ab315SDavid Howells  * but we leave open this being overridden in the future
3328a1ab315SDavid Howells  */
3338a1ab315SDavid Howells #ifndef __ARCH_SIGEV_PREAMBLE_SIZE
3348a1ab315SDavid Howells #define __ARCH_SIGEV_PREAMBLE_SIZE	(sizeof(int) * 2 + sizeof(sigval_t))
3358a1ab315SDavid Howells #endif
3368a1ab315SDavid Howells 
3378a1ab315SDavid Howells #define SIGEV_MAX_SIZE	64
3388a1ab315SDavid Howells #define SIGEV_PAD_SIZE	((SIGEV_MAX_SIZE - __ARCH_SIGEV_PREAMBLE_SIZE) \
3398a1ab315SDavid Howells 		/ sizeof(int))
3408a1ab315SDavid Howells 
3418a1ab315SDavid Howells typedef struct sigevent {
3428a1ab315SDavid Howells 	sigval_t sigev_value;
3438a1ab315SDavid Howells 	int sigev_signo;
3448a1ab315SDavid Howells 	int sigev_notify;
3458a1ab315SDavid Howells 	union {
3468a1ab315SDavid Howells 		int _pad[SIGEV_PAD_SIZE];
3478a1ab315SDavid Howells 		 int _tid;
3488a1ab315SDavid Howells 
3498a1ab315SDavid Howells 		struct {
3508a1ab315SDavid Howells 			void (*_function)(sigval_t);
3518a1ab315SDavid Howells 			void *_attribute;	/* really pthread_attr_t */
3528a1ab315SDavid Howells 		} _sigev_thread;
3538a1ab315SDavid Howells 	} _sigev_un;
3548a1ab315SDavid Howells } sigevent_t;
3558a1ab315SDavid Howells 
3568a1ab315SDavid Howells #define sigev_notify_function	_sigev_un._sigev_thread._function
3578a1ab315SDavid Howells #define sigev_notify_attributes	_sigev_un._sigev_thread._attribute
3588a1ab315SDavid Howells #define sigev_notify_thread_id	 _sigev_un._tid
3598a1ab315SDavid Howells 
3608a1ab315SDavid Howells 
3618a1ab315SDavid Howells #endif /* _UAPI_ASM_GENERIC_SIGINFO_H */
362