162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
262306a36Sopenharmony_ci#ifndef _UAPI_ASM_GENERIC_SIGINFO_H
362306a36Sopenharmony_ci#define _UAPI_ASM_GENERIC_SIGINFO_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#include <linux/compiler.h>
662306a36Sopenharmony_ci#include <linux/types.h>
762306a36Sopenharmony_ci
862306a36Sopenharmony_citypedef union sigval {
962306a36Sopenharmony_ci	int sival_int;
1062306a36Sopenharmony_ci	void __user *sival_ptr;
1162306a36Sopenharmony_ci} sigval_t;
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci#define SI_MAX_SIZE	128
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci/*
1662306a36Sopenharmony_ci * The default "si_band" type is "long", as specified by POSIX.
1762306a36Sopenharmony_ci * However, some architectures want to override this to "int"
1862306a36Sopenharmony_ci * for historical compatibility reasons, so we allow that.
1962306a36Sopenharmony_ci */
2062306a36Sopenharmony_ci#ifndef __ARCH_SI_BAND_T
2162306a36Sopenharmony_ci#define __ARCH_SI_BAND_T long
2262306a36Sopenharmony_ci#endif
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci#ifndef __ARCH_SI_CLOCK_T
2562306a36Sopenharmony_ci#define __ARCH_SI_CLOCK_T __kernel_clock_t
2662306a36Sopenharmony_ci#endif
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci#ifndef __ARCH_SI_ATTRIBUTES
2962306a36Sopenharmony_ci#define __ARCH_SI_ATTRIBUTES
3062306a36Sopenharmony_ci#endif
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci/*
3362306a36Sopenharmony_ci * Be careful when extending this union.  On 32bit siginfo_t is 32bit
3462306a36Sopenharmony_ci * aligned.  Which means that a 64bit field or any other field that
3562306a36Sopenharmony_ci * would increase the alignment of siginfo_t will break the ABI.
3662306a36Sopenharmony_ci */
3762306a36Sopenharmony_ciunion __sifields {
3862306a36Sopenharmony_ci	/* kill() */
3962306a36Sopenharmony_ci	struct {
4062306a36Sopenharmony_ci		__kernel_pid_t _pid;	/* sender's pid */
4162306a36Sopenharmony_ci		__kernel_uid32_t _uid;	/* sender's uid */
4262306a36Sopenharmony_ci	} _kill;
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci	/* POSIX.1b timers */
4562306a36Sopenharmony_ci	struct {
4662306a36Sopenharmony_ci		__kernel_timer_t _tid;	/* timer id */
4762306a36Sopenharmony_ci		int _overrun;		/* overrun count */
4862306a36Sopenharmony_ci		sigval_t _sigval;	/* same as below */
4962306a36Sopenharmony_ci		int _sys_private;       /* not to be passed to user */
5062306a36Sopenharmony_ci	} _timer;
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci	/* POSIX.1b signals */
5362306a36Sopenharmony_ci	struct {
5462306a36Sopenharmony_ci		__kernel_pid_t _pid;	/* sender's pid */
5562306a36Sopenharmony_ci		__kernel_uid32_t _uid;	/* sender's uid */
5662306a36Sopenharmony_ci		sigval_t _sigval;
5762306a36Sopenharmony_ci	} _rt;
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci	/* SIGCHLD */
6062306a36Sopenharmony_ci	struct {
6162306a36Sopenharmony_ci		__kernel_pid_t _pid;	/* which child */
6262306a36Sopenharmony_ci		__kernel_uid32_t _uid;	/* sender's uid */
6362306a36Sopenharmony_ci		int _status;		/* exit code */
6462306a36Sopenharmony_ci		__ARCH_SI_CLOCK_T _utime;
6562306a36Sopenharmony_ci		__ARCH_SI_CLOCK_T _stime;
6662306a36Sopenharmony_ci	} _sigchld;
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci	/* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */
6962306a36Sopenharmony_ci	struct {
7062306a36Sopenharmony_ci		void __user *_addr; /* faulting insn/memory ref. */
7162306a36Sopenharmony_ci#ifdef __ia64__
7262306a36Sopenharmony_ci		int _imm;		/* immediate value for "break" */
7362306a36Sopenharmony_ci		unsigned int _flags;	/* see ia64 si_flags */
7462306a36Sopenharmony_ci		unsigned long _isr;	/* isr */
7562306a36Sopenharmony_ci#endif
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci#define __ADDR_BND_PKEY_PAD  (__alignof__(void *) < sizeof(short) ? \
7862306a36Sopenharmony_ci			      sizeof(short) : __alignof__(void *))
7962306a36Sopenharmony_ci		union {
8062306a36Sopenharmony_ci			/* used on alpha and sparc */
8162306a36Sopenharmony_ci			int _trapno;	/* TRAP # which caused the signal */
8262306a36Sopenharmony_ci			/*
8362306a36Sopenharmony_ci			 * used when si_code=BUS_MCEERR_AR or
8462306a36Sopenharmony_ci			 * used when si_code=BUS_MCEERR_AO
8562306a36Sopenharmony_ci			 */
8662306a36Sopenharmony_ci			short _addr_lsb; /* LSB of the reported address */
8762306a36Sopenharmony_ci			/* used when si_code=SEGV_BNDERR */
8862306a36Sopenharmony_ci			struct {
8962306a36Sopenharmony_ci				char _dummy_bnd[__ADDR_BND_PKEY_PAD];
9062306a36Sopenharmony_ci				void __user *_lower;
9162306a36Sopenharmony_ci				void __user *_upper;
9262306a36Sopenharmony_ci			} _addr_bnd;
9362306a36Sopenharmony_ci			/* used when si_code=SEGV_PKUERR */
9462306a36Sopenharmony_ci			struct {
9562306a36Sopenharmony_ci				char _dummy_pkey[__ADDR_BND_PKEY_PAD];
9662306a36Sopenharmony_ci				__u32 _pkey;
9762306a36Sopenharmony_ci			} _addr_pkey;
9862306a36Sopenharmony_ci			/* used when si_code=TRAP_PERF */
9962306a36Sopenharmony_ci			struct {
10062306a36Sopenharmony_ci				unsigned long _data;
10162306a36Sopenharmony_ci				__u32 _type;
10262306a36Sopenharmony_ci				__u32 _flags;
10362306a36Sopenharmony_ci			} _perf;
10462306a36Sopenharmony_ci		};
10562306a36Sopenharmony_ci	} _sigfault;
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_ci	/* SIGPOLL */
10862306a36Sopenharmony_ci	struct {
10962306a36Sopenharmony_ci		__ARCH_SI_BAND_T _band;	/* POLL_IN, POLL_OUT, POLL_MSG */
11062306a36Sopenharmony_ci		int _fd;
11162306a36Sopenharmony_ci	} _sigpoll;
11262306a36Sopenharmony_ci
11362306a36Sopenharmony_ci	/* SIGSYS */
11462306a36Sopenharmony_ci	struct {
11562306a36Sopenharmony_ci		void __user *_call_addr; /* calling user insn */
11662306a36Sopenharmony_ci		int _syscall;	/* triggering system call number */
11762306a36Sopenharmony_ci		unsigned int _arch;	/* AUDIT_ARCH_* of syscall */
11862306a36Sopenharmony_ci	} _sigsys;
11962306a36Sopenharmony_ci};
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci#ifndef __ARCH_HAS_SWAPPED_SIGINFO
12262306a36Sopenharmony_ci#define __SIGINFO 			\
12362306a36Sopenharmony_cistruct {				\
12462306a36Sopenharmony_ci	int si_signo;			\
12562306a36Sopenharmony_ci	int si_errno;			\
12662306a36Sopenharmony_ci	int si_code;			\
12762306a36Sopenharmony_ci	union __sifields _sifields;	\
12862306a36Sopenharmony_ci}
12962306a36Sopenharmony_ci#else
13062306a36Sopenharmony_ci#define __SIGINFO 			\
13162306a36Sopenharmony_cistruct {				\
13262306a36Sopenharmony_ci	int si_signo;			\
13362306a36Sopenharmony_ci	int si_code;			\
13462306a36Sopenharmony_ci	int si_errno;			\
13562306a36Sopenharmony_ci	union __sifields _sifields;	\
13662306a36Sopenharmony_ci}
13762306a36Sopenharmony_ci#endif /* __ARCH_HAS_SWAPPED_SIGINFO */
13862306a36Sopenharmony_ci
13962306a36Sopenharmony_citypedef struct siginfo {
14062306a36Sopenharmony_ci	union {
14162306a36Sopenharmony_ci		__SIGINFO;
14262306a36Sopenharmony_ci		int _si_pad[SI_MAX_SIZE/sizeof(int)];
14362306a36Sopenharmony_ci	};
14462306a36Sopenharmony_ci} __ARCH_SI_ATTRIBUTES siginfo_t;
14562306a36Sopenharmony_ci
14662306a36Sopenharmony_ci/*
14762306a36Sopenharmony_ci * How these fields are to be accessed.
14862306a36Sopenharmony_ci */
14962306a36Sopenharmony_ci#define si_pid		_sifields._kill._pid
15062306a36Sopenharmony_ci#define si_uid		_sifields._kill._uid
15162306a36Sopenharmony_ci#define si_tid		_sifields._timer._tid
15262306a36Sopenharmony_ci#define si_overrun	_sifields._timer._overrun
15362306a36Sopenharmony_ci#define si_sys_private  _sifields._timer._sys_private
15462306a36Sopenharmony_ci#define si_status	_sifields._sigchld._status
15562306a36Sopenharmony_ci#define si_utime	_sifields._sigchld._utime
15662306a36Sopenharmony_ci#define si_stime	_sifields._sigchld._stime
15762306a36Sopenharmony_ci#define si_value	_sifields._rt._sigval
15862306a36Sopenharmony_ci#define si_int		_sifields._rt._sigval.sival_int
15962306a36Sopenharmony_ci#define si_ptr		_sifields._rt._sigval.sival_ptr
16062306a36Sopenharmony_ci#define si_addr		_sifields._sigfault._addr
16162306a36Sopenharmony_ci#define si_trapno	_sifields._sigfault._trapno
16262306a36Sopenharmony_ci#define si_addr_lsb	_sifields._sigfault._addr_lsb
16362306a36Sopenharmony_ci#define si_lower	_sifields._sigfault._addr_bnd._lower
16462306a36Sopenharmony_ci#define si_upper	_sifields._sigfault._addr_bnd._upper
16562306a36Sopenharmony_ci#define si_pkey		_sifields._sigfault._addr_pkey._pkey
16662306a36Sopenharmony_ci#define si_perf_data	_sifields._sigfault._perf._data
16762306a36Sopenharmony_ci#define si_perf_type	_sifields._sigfault._perf._type
16862306a36Sopenharmony_ci#define si_perf_flags	_sifields._sigfault._perf._flags
16962306a36Sopenharmony_ci#define si_band		_sifields._sigpoll._band
17062306a36Sopenharmony_ci#define si_fd		_sifields._sigpoll._fd
17162306a36Sopenharmony_ci#define si_call_addr	_sifields._sigsys._call_addr
17262306a36Sopenharmony_ci#define si_syscall	_sifields._sigsys._syscall
17362306a36Sopenharmony_ci#define si_arch		_sifields._sigsys._arch
17462306a36Sopenharmony_ci
17562306a36Sopenharmony_ci/*
17662306a36Sopenharmony_ci * si_code values
17762306a36Sopenharmony_ci * Digital reserves positive values for kernel-generated signals.
17862306a36Sopenharmony_ci */
17962306a36Sopenharmony_ci#define SI_USER		0		/* sent by kill, sigsend, raise */
18062306a36Sopenharmony_ci#define SI_KERNEL	0x80		/* sent by the kernel from somewhere */
18162306a36Sopenharmony_ci#define SI_QUEUE	-1		/* sent by sigqueue */
18262306a36Sopenharmony_ci#define SI_TIMER	-2		/* sent by timer expiration */
18362306a36Sopenharmony_ci#define SI_MESGQ	-3		/* sent by real time mesq state change */
18462306a36Sopenharmony_ci#define SI_ASYNCIO	-4		/* sent by AIO completion */
18562306a36Sopenharmony_ci#define SI_SIGIO	-5		/* sent by queued SIGIO */
18662306a36Sopenharmony_ci#define SI_TKILL	-6		/* sent by tkill system call */
18762306a36Sopenharmony_ci#define SI_DETHREAD	-7		/* sent by execve() killing subsidiary threads */
18862306a36Sopenharmony_ci#define SI_ASYNCNL	-60		/* sent by glibc async name lookup completion */
18962306a36Sopenharmony_ci
19062306a36Sopenharmony_ci#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0)
19162306a36Sopenharmony_ci#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0)
19262306a36Sopenharmony_ci
19362306a36Sopenharmony_ci/*
19462306a36Sopenharmony_ci * SIGILL si_codes
19562306a36Sopenharmony_ci */
19662306a36Sopenharmony_ci#define ILL_ILLOPC	1	/* illegal opcode */
19762306a36Sopenharmony_ci#define ILL_ILLOPN	2	/* illegal operand */
19862306a36Sopenharmony_ci#define ILL_ILLADR	3	/* illegal addressing mode */
19962306a36Sopenharmony_ci#define ILL_ILLTRP	4	/* illegal trap */
20062306a36Sopenharmony_ci#define ILL_PRVOPC	5	/* privileged opcode */
20162306a36Sopenharmony_ci#define ILL_PRVREG	6	/* privileged register */
20262306a36Sopenharmony_ci#define ILL_COPROC	7	/* coprocessor error */
20362306a36Sopenharmony_ci#define ILL_BADSTK	8	/* internal stack error */
20462306a36Sopenharmony_ci#define ILL_BADIADDR	9	/* unimplemented instruction address */
20562306a36Sopenharmony_ci#define __ILL_BREAK	10	/* illegal break */
20662306a36Sopenharmony_ci#define __ILL_BNDMOD	11	/* bundle-update (modification) in progress */
20762306a36Sopenharmony_ci#define NSIGILL		11
20862306a36Sopenharmony_ci
20962306a36Sopenharmony_ci/*
21062306a36Sopenharmony_ci * SIGFPE si_codes
21162306a36Sopenharmony_ci */
21262306a36Sopenharmony_ci#define FPE_INTDIV	1	/* integer divide by zero */
21362306a36Sopenharmony_ci#define FPE_INTOVF	2	/* integer overflow */
21462306a36Sopenharmony_ci#define FPE_FLTDIV	3	/* floating point divide by zero */
21562306a36Sopenharmony_ci#define FPE_FLTOVF	4	/* floating point overflow */
21662306a36Sopenharmony_ci#define FPE_FLTUND	5	/* floating point underflow */
21762306a36Sopenharmony_ci#define FPE_FLTRES	6	/* floating point inexact result */
21862306a36Sopenharmony_ci#define FPE_FLTINV	7	/* floating point invalid operation */
21962306a36Sopenharmony_ci#define FPE_FLTSUB	8	/* subscript out of range */
22062306a36Sopenharmony_ci#define __FPE_DECOVF	9	/* decimal overflow */
22162306a36Sopenharmony_ci#define __FPE_DECDIV	10	/* decimal division by zero */
22262306a36Sopenharmony_ci#define __FPE_DECERR	11	/* packed decimal error */
22362306a36Sopenharmony_ci#define __FPE_INVASC	12	/* invalid ASCII digit */
22462306a36Sopenharmony_ci#define __FPE_INVDEC	13	/* invalid decimal digit */
22562306a36Sopenharmony_ci#define FPE_FLTUNK	14	/* undiagnosed floating-point exception */
22662306a36Sopenharmony_ci#define FPE_CONDTRAP	15	/* trap on condition */
22762306a36Sopenharmony_ci#define NSIGFPE		15
22862306a36Sopenharmony_ci
22962306a36Sopenharmony_ci/*
23062306a36Sopenharmony_ci * SIGSEGV si_codes
23162306a36Sopenharmony_ci */
23262306a36Sopenharmony_ci#define SEGV_MAPERR	1	/* address not mapped to object */
23362306a36Sopenharmony_ci#define SEGV_ACCERR	2	/* invalid permissions for mapped object */
23462306a36Sopenharmony_ci#define SEGV_BNDERR	3	/* failed address bound checks */
23562306a36Sopenharmony_ci#ifdef __ia64__
23662306a36Sopenharmony_ci# define __SEGV_PSTKOVF	4	/* paragraph stack overflow */
23762306a36Sopenharmony_ci#else
23862306a36Sopenharmony_ci# define SEGV_PKUERR	4	/* failed protection key checks */
23962306a36Sopenharmony_ci#endif
24062306a36Sopenharmony_ci#define SEGV_ACCADI	5	/* ADI not enabled for mapped object */
24162306a36Sopenharmony_ci#define SEGV_ADIDERR	6	/* Disrupting MCD error */
24262306a36Sopenharmony_ci#define SEGV_ADIPERR	7	/* Precise MCD exception */
24362306a36Sopenharmony_ci#define SEGV_MTEAERR	8	/* Asynchronous ARM MTE error */
24462306a36Sopenharmony_ci#define SEGV_MTESERR	9	/* Synchronous ARM MTE exception */
24562306a36Sopenharmony_ci#define SEGV_CPERR	10	/* Control protection fault */
24662306a36Sopenharmony_ci#define NSIGSEGV	10
24762306a36Sopenharmony_ci
24862306a36Sopenharmony_ci/*
24962306a36Sopenharmony_ci * SIGBUS si_codes
25062306a36Sopenharmony_ci */
25162306a36Sopenharmony_ci#define BUS_ADRALN	1	/* invalid address alignment */
25262306a36Sopenharmony_ci#define BUS_ADRERR	2	/* non-existent physical address */
25362306a36Sopenharmony_ci#define BUS_OBJERR	3	/* object specific hardware error */
25462306a36Sopenharmony_ci/* hardware memory error consumed on a machine check: action required */
25562306a36Sopenharmony_ci#define BUS_MCEERR_AR	4
25662306a36Sopenharmony_ci/* hardware memory error detected in process but not consumed: action optional*/
25762306a36Sopenharmony_ci#define BUS_MCEERR_AO	5
25862306a36Sopenharmony_ci#define NSIGBUS		5
25962306a36Sopenharmony_ci
26062306a36Sopenharmony_ci/*
26162306a36Sopenharmony_ci * SIGTRAP si_codes
26262306a36Sopenharmony_ci */
26362306a36Sopenharmony_ci#define TRAP_BRKPT	1	/* process breakpoint */
26462306a36Sopenharmony_ci#define TRAP_TRACE	2	/* process trace trap */
26562306a36Sopenharmony_ci#define TRAP_BRANCH     3	/* process taken branch trap */
26662306a36Sopenharmony_ci#define TRAP_HWBKPT     4	/* hardware breakpoint/watchpoint */
26762306a36Sopenharmony_ci#define TRAP_UNK	5	/* undiagnosed trap */
26862306a36Sopenharmony_ci#define TRAP_PERF	6	/* perf event with sigtrap=1 */
26962306a36Sopenharmony_ci#define NSIGTRAP	6
27062306a36Sopenharmony_ci
27162306a36Sopenharmony_ci/*
27262306a36Sopenharmony_ci * There is an additional set of SIGTRAP si_codes used by ptrace
27362306a36Sopenharmony_ci * that are of the form: ((PTRACE_EVENT_XXX << 8) | SIGTRAP)
27462306a36Sopenharmony_ci */
27562306a36Sopenharmony_ci
27662306a36Sopenharmony_ci/*
27762306a36Sopenharmony_ci * Flags for si_perf_flags if SIGTRAP si_code is TRAP_PERF.
27862306a36Sopenharmony_ci */
27962306a36Sopenharmony_ci#define TRAP_PERF_FLAG_ASYNC (1u << 0)
28062306a36Sopenharmony_ci
28162306a36Sopenharmony_ci/*
28262306a36Sopenharmony_ci * SIGCHLD si_codes
28362306a36Sopenharmony_ci */
28462306a36Sopenharmony_ci#define CLD_EXITED	1	/* child has exited */
28562306a36Sopenharmony_ci#define CLD_KILLED	2	/* child was killed */
28662306a36Sopenharmony_ci#define CLD_DUMPED	3	/* child terminated abnormally */
28762306a36Sopenharmony_ci#define CLD_TRAPPED	4	/* traced child has trapped */
28862306a36Sopenharmony_ci#define CLD_STOPPED	5	/* child has stopped */
28962306a36Sopenharmony_ci#define CLD_CONTINUED	6	/* stopped child has continued */
29062306a36Sopenharmony_ci#define NSIGCHLD	6
29162306a36Sopenharmony_ci
29262306a36Sopenharmony_ci/*
29362306a36Sopenharmony_ci * SIGPOLL (or any other signal without signal specific si_codes) si_codes
29462306a36Sopenharmony_ci */
29562306a36Sopenharmony_ci#define POLL_IN		1	/* data input available */
29662306a36Sopenharmony_ci#define POLL_OUT	2	/* output buffers available */
29762306a36Sopenharmony_ci#define POLL_MSG	3	/* input message available */
29862306a36Sopenharmony_ci#define POLL_ERR	4	/* i/o error */
29962306a36Sopenharmony_ci#define POLL_PRI	5	/* high priority input available */
30062306a36Sopenharmony_ci#define POLL_HUP	6	/* device disconnected */
30162306a36Sopenharmony_ci#define NSIGPOLL	6
30262306a36Sopenharmony_ci
30362306a36Sopenharmony_ci/*
30462306a36Sopenharmony_ci * SIGSYS si_codes
30562306a36Sopenharmony_ci */
30662306a36Sopenharmony_ci#define SYS_SECCOMP	1	/* seccomp triggered */
30762306a36Sopenharmony_ci#define SYS_USER_DISPATCH 2	/* syscall user dispatch triggered */
30862306a36Sopenharmony_ci#define NSIGSYS		2
30962306a36Sopenharmony_ci
31062306a36Sopenharmony_ci/*
31162306a36Sopenharmony_ci * SIGEMT si_codes
31262306a36Sopenharmony_ci */
31362306a36Sopenharmony_ci#define EMT_TAGOVF	1	/* tag overflow */
31462306a36Sopenharmony_ci#define NSIGEMT		1
31562306a36Sopenharmony_ci
31662306a36Sopenharmony_ci/*
31762306a36Sopenharmony_ci * sigevent definitions
31862306a36Sopenharmony_ci *
31962306a36Sopenharmony_ci * It seems likely that SIGEV_THREAD will have to be handled from
32062306a36Sopenharmony_ci * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
32162306a36Sopenharmony_ci * thread manager then catches and does the appropriate nonsense.
32262306a36Sopenharmony_ci * However, everything is written out here so as to not get lost.
32362306a36Sopenharmony_ci */
32462306a36Sopenharmony_ci#define SIGEV_SIGNAL	0	/* notify via signal */
32562306a36Sopenharmony_ci#define SIGEV_NONE	1	/* other notification: meaningless */
32662306a36Sopenharmony_ci#define SIGEV_THREAD	2	/* deliver via thread creation */
32762306a36Sopenharmony_ci#define SIGEV_THREAD_ID 4	/* deliver to thread */
32862306a36Sopenharmony_ci
32962306a36Sopenharmony_ci/*
33062306a36Sopenharmony_ci * This works because the alignment is ok on all current architectures
33162306a36Sopenharmony_ci * but we leave open this being overridden in the future
33262306a36Sopenharmony_ci */
33362306a36Sopenharmony_ci#ifndef __ARCH_SIGEV_PREAMBLE_SIZE
33462306a36Sopenharmony_ci#define __ARCH_SIGEV_PREAMBLE_SIZE	(sizeof(int) * 2 + sizeof(sigval_t))
33562306a36Sopenharmony_ci#endif
33662306a36Sopenharmony_ci
33762306a36Sopenharmony_ci#define SIGEV_MAX_SIZE	64
33862306a36Sopenharmony_ci#define SIGEV_PAD_SIZE	((SIGEV_MAX_SIZE - __ARCH_SIGEV_PREAMBLE_SIZE) \
33962306a36Sopenharmony_ci		/ sizeof(int))
34062306a36Sopenharmony_ci
34162306a36Sopenharmony_citypedef struct sigevent {
34262306a36Sopenharmony_ci	sigval_t sigev_value;
34362306a36Sopenharmony_ci	int sigev_signo;
34462306a36Sopenharmony_ci	int sigev_notify;
34562306a36Sopenharmony_ci	union {
34662306a36Sopenharmony_ci		int _pad[SIGEV_PAD_SIZE];
34762306a36Sopenharmony_ci		 int _tid;
34862306a36Sopenharmony_ci
34962306a36Sopenharmony_ci		struct {
35062306a36Sopenharmony_ci			void (*_function)(sigval_t);
35162306a36Sopenharmony_ci			void *_attribute;	/* really pthread_attr_t */
35262306a36Sopenharmony_ci		} _sigev_thread;
35362306a36Sopenharmony_ci	} _sigev_un;
35462306a36Sopenharmony_ci} sigevent_t;
35562306a36Sopenharmony_ci
35662306a36Sopenharmony_ci#define sigev_notify_function	_sigev_un._sigev_thread._function
35762306a36Sopenharmony_ci#define sigev_notify_attributes	_sigev_un._sigev_thread._attribute
35862306a36Sopenharmony_ci#define sigev_notify_thread_id	 _sigev_un._tid
35962306a36Sopenharmony_ci
36062306a36Sopenharmony_ci
36162306a36Sopenharmony_ci#endif /* _UAPI_ASM_GENERIC_SIGINFO_H */
362