blob: f98fd7345e34192816f5eafce6d61b1f8c3b36ed [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_ASM_GENERIC_SIGINFO_H
20#define _UAPI_ASM_GENERIC_SIGINFO_H
21#include <linux/compiler.h>
22#include <linux/types.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023typedef union sigval {
Tao Baod7db5942015-01-28 10:07:51 -080024 int sival_int;
25 void __user * sival_ptr;
Ben Cheng655a7c02013-10-16 16:09:24 -070026} sigval_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070027#ifndef __ARCH_SI_PREAMBLE_SIZE
28#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
29#endif
30#define SI_MAX_SIZE 128
Ben Cheng655a7c02013-10-16 16:09:24 -070031#ifndef SI_PAD_SIZE
32#define SI_PAD_SIZE ((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof(int))
33#endif
34#ifndef __ARCH_SI_UID_T
Ben Cheng655a7c02013-10-16 16:09:24 -070035#define __ARCH_SI_UID_T __kernel_uid32_t
36#endif
37#ifndef __ARCH_SI_BAND_T
38#define __ARCH_SI_BAND_T long
Ben Cheng655a7c02013-10-16 16:09:24 -070039#endif
40#ifndef __ARCH_SI_CLOCK_T
41#define __ARCH_SI_CLOCK_T __kernel_clock_t
42#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070043#ifndef __ARCH_SI_ATTRIBUTES
44#define __ARCH_SI_ATTRIBUTES
45#endif
46#ifndef HAVE_ARCH_SIGINFO_T
Ben Cheng655a7c02013-10-16 16:09:24 -070047typedef struct siginfo {
Tao Baod7db5942015-01-28 10:07:51 -080048 int si_signo;
49 int si_errno;
50 int si_code;
Tao Baod7db5942015-01-28 10:07:51 -080051 union {
52 int _pad[SI_PAD_SIZE];
53 struct {
54 __kernel_pid_t _pid;
Tao Baod7db5942015-01-28 10:07:51 -080055 __ARCH_SI_UID_T _uid;
56 } _kill;
57 struct {
58 __kernel_timer_t _tid;
Tao Baod7db5942015-01-28 10:07:51 -080059 int _overrun;
60 char _pad[sizeof(__ARCH_SI_UID_T) - sizeof(int)];
61 sigval_t _sigval;
62 int _sys_private;
Tao Baod7db5942015-01-28 10:07:51 -080063 } _timer;
64 struct {
65 __kernel_pid_t _pid;
66 __ARCH_SI_UID_T _uid;
Tao Baod7db5942015-01-28 10:07:51 -080067 sigval_t _sigval;
68 } _rt;
69 struct {
70 __kernel_pid_t _pid;
Tao Baod7db5942015-01-28 10:07:51 -080071 __ARCH_SI_UID_T _uid;
72 int _status;
73 __ARCH_SI_CLOCK_T _utime;
74 __ARCH_SI_CLOCK_T _stime;
Tao Baod7db5942015-01-28 10:07:51 -080075 } _sigchld;
76 struct {
77 void __user * _addr;
Ben Cheng655a7c02013-10-16 16:09:24 -070078#ifdef __ARCH_SI_TRAPNO
Tao Baod7db5942015-01-28 10:07:51 -080079 int _trapno;
Ben Cheng655a7c02013-10-16 16:09:24 -070080#endif
Tao Baod7db5942015-01-28 10:07:51 -080081 short _addr_lsb;
Christopher Ferris106b3a82016-08-24 12:15:38 -070082 union {
Christopher Ferris106b3a82016-08-24 12:15:38 -070083 struct {
84 void __user * _lower;
85 void __user * _upper;
86 } _addr_bnd;
Christopher Ferris106b3a82016-08-24 12:15:38 -070087 __u32 _pkey;
88 };
Tao Baod7db5942015-01-28 10:07:51 -080089 } _sigfault;
Tao Baod7db5942015-01-28 10:07:51 -080090 struct {
91 __ARCH_SI_BAND_T _band;
92 int _fd;
93 } _sigpoll;
Tao Baod7db5942015-01-28 10:07:51 -080094 struct {
95 void __user * _call_addr;
96 int _syscall;
97 unsigned int _arch;
Tao Baod7db5942015-01-28 10:07:51 -080098 } _sigsys;
99 } _sifields;
Ben Cheng655a7c02013-10-16 16:09:24 -0700100} __ARCH_SI_ATTRIBUTES siginfo_t;
101#define __ARCH_SIGSYS
Ben Cheng655a7c02013-10-16 16:09:24 -0700102#endif
103#define si_pid _sifields._kill._pid
104#define si_uid _sifields._kill._uid
105#define si_tid _sifields._timer._tid
Ben Cheng655a7c02013-10-16 16:09:24 -0700106#define si_overrun _sifields._timer._overrun
107#define si_sys_private _sifields._timer._sys_private
108#define si_status _sifields._sigchld._status
109#define si_utime _sifields._sigchld._utime
Ben Cheng655a7c02013-10-16 16:09:24 -0700110#define si_stime _sifields._sigchld._stime
111#define si_value _sifields._rt._sigval
112#define si_int _sifields._rt._sigval.sival_int
113#define si_ptr _sifields._rt._sigval.sival_ptr
Ben Cheng655a7c02013-10-16 16:09:24 -0700114#define si_addr _sifields._sigfault._addr
115#ifdef __ARCH_SI_TRAPNO
116#define si_trapno _sifields._sigfault._trapno
117#endif
Ben Cheng655a7c02013-10-16 16:09:24 -0700118#define si_addr_lsb _sifields._sigfault._addr_lsb
Christopher Ferris05d08e92016-02-04 13:16:38 -0800119#define si_lower _sifields._sigfault._addr_bnd._lower
120#define si_upper _sifields._sigfault._addr_bnd._upper
Christopher Ferris106b3a82016-08-24 12:15:38 -0700121#define si_pkey _sifields._sigfault._pkey
Ben Cheng655a7c02013-10-16 16:09:24 -0700122#define si_band _sifields._sigpoll._band
123#define si_fd _sifields._sigpoll._fd
124#ifdef __ARCH_SIGSYS
Ben Cheng655a7c02013-10-16 16:09:24 -0700125#define si_call_addr _sifields._sigsys._call_addr
126#define si_syscall _sifields._sigsys._syscall
127#define si_arch _sifields._sigsys._arch
128#endif
Ben Cheng655a7c02013-10-16 16:09:24 -0700129#define __SI_KILL 0
130#define __SI_TIMER 0
131#define __SI_POLL 0
132#define __SI_FAULT 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700133#define __SI_CHLD 0
134#define __SI_RT 0
135#define __SI_MESGQ 0
136#define __SI_SYS 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700137#define __SI_CODE(T,N) (N)
138#define SI_USER 0
139#define SI_KERNEL 0x80
Tao Baod7db5942015-01-28 10:07:51 -0800140#define SI_QUEUE - 1
Tao Baod7db5942015-01-28 10:07:51 -0800141#define SI_TIMER __SI_CODE(__SI_TIMER, - 2)
142#define SI_MESGQ __SI_CODE(__SI_MESGQ, - 3)
143#define SI_ASYNCIO - 4
144#define SI_SIGIO - 5
Tao Baod7db5942015-01-28 10:07:51 -0800145#define SI_TKILL - 6
146#define SI_DETHREAD - 7
Ben Cheng655a7c02013-10-16 16:09:24 -0700147#define SI_FROMUSER(siptr) ((siptr)->si_code <= 0)
148#define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0)
Tao Baod7db5942015-01-28 10:07:51 -0800149#define ILL_ILLOPC (__SI_FAULT | 1)
150#define ILL_ILLOPN (__SI_FAULT | 2)
151#define ILL_ILLADR (__SI_FAULT | 3)
152#define ILL_ILLTRP (__SI_FAULT | 4)
Tao Baod7db5942015-01-28 10:07:51 -0800153#define ILL_PRVOPC (__SI_FAULT | 5)
154#define ILL_PRVREG (__SI_FAULT | 6)
155#define ILL_COPROC (__SI_FAULT | 7)
156#define ILL_BADSTK (__SI_FAULT | 8)
Ben Cheng655a7c02013-10-16 16:09:24 -0700157#define NSIGILL 8
Tao Baod7db5942015-01-28 10:07:51 -0800158#define FPE_INTDIV (__SI_FAULT | 1)
159#define FPE_INTOVF (__SI_FAULT | 2)
160#define FPE_FLTDIV (__SI_FAULT | 3)
Tao Baod7db5942015-01-28 10:07:51 -0800161#define FPE_FLTOVF (__SI_FAULT | 4)
162#define FPE_FLTUND (__SI_FAULT | 5)
163#define FPE_FLTRES (__SI_FAULT | 6)
164#define FPE_FLTINV (__SI_FAULT | 7)
Tao Baod7db5942015-01-28 10:07:51 -0800165#define FPE_FLTSUB (__SI_FAULT | 8)
Ben Cheng655a7c02013-10-16 16:09:24 -0700166#define NSIGFPE 8
Tao Baod7db5942015-01-28 10:07:51 -0800167#define SEGV_MAPERR (__SI_FAULT | 1)
168#define SEGV_ACCERR (__SI_FAULT | 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800169#define SEGV_BNDERR (__SI_FAULT | 3)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700170#define SEGV_PKUERR (__SI_FAULT | 4)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700171#define NSIGSEGV 4
Tao Baod7db5942015-01-28 10:07:51 -0800172#define BUS_ADRALN (__SI_FAULT | 1)
173#define BUS_ADRERR (__SI_FAULT | 2)
174#define BUS_OBJERR (__SI_FAULT | 3)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700175#define BUS_MCEERR_AR (__SI_FAULT | 4)
Tao Baod7db5942015-01-28 10:07:51 -0800176#define BUS_MCEERR_AO (__SI_FAULT | 5)
Ben Cheng655a7c02013-10-16 16:09:24 -0700177#define NSIGBUS 5
Tao Baod7db5942015-01-28 10:07:51 -0800178#define TRAP_BRKPT (__SI_FAULT | 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700179#define TRAP_TRACE (__SI_FAULT | 2)
Tao Baod7db5942015-01-28 10:07:51 -0800180#define TRAP_BRANCH (__SI_FAULT | 3)
181#define TRAP_HWBKPT (__SI_FAULT | 4)
Ben Cheng655a7c02013-10-16 16:09:24 -0700182#define NSIGTRAP 4
Christopher Ferris106b3a82016-08-24 12:15:38 -0700183#define CLD_EXITED (__SI_CHLD | 1)
Tao Baod7db5942015-01-28 10:07:51 -0800184#define CLD_KILLED (__SI_CHLD | 2)
185#define CLD_DUMPED (__SI_CHLD | 3)
186#define CLD_TRAPPED (__SI_CHLD | 4)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700187#define CLD_STOPPED (__SI_CHLD | 5)
Tao Baod7db5942015-01-28 10:07:51 -0800188#define CLD_CONTINUED (__SI_CHLD | 6)
Ben Cheng655a7c02013-10-16 16:09:24 -0700189#define NSIGCHLD 6
Tao Baod7db5942015-01-28 10:07:51 -0800190#define POLL_IN (__SI_POLL | 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700191#define POLL_OUT (__SI_POLL | 2)
Tao Baod7db5942015-01-28 10:07:51 -0800192#define POLL_MSG (__SI_POLL | 3)
193#define POLL_ERR (__SI_POLL | 4)
194#define POLL_PRI (__SI_POLL | 5)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700195#define POLL_HUP (__SI_POLL | 6)
Ben Cheng655a7c02013-10-16 16:09:24 -0700196#define NSIGPOLL 6
Tao Baod7db5942015-01-28 10:07:51 -0800197#define SYS_SECCOMP (__SI_SYS | 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700198#define NSIGSYS 1
Christopher Ferris106b3a82016-08-24 12:15:38 -0700199#define SIGEV_SIGNAL 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700200#define SIGEV_NONE 1
201#define SIGEV_THREAD 2
202#define SIGEV_THREAD_ID 4
Christopher Ferris106b3a82016-08-24 12:15:38 -0700203#ifndef __ARCH_SIGEV_PREAMBLE_SIZE
Ben Cheng655a7c02013-10-16 16:09:24 -0700204#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(int) * 2 + sizeof(sigval_t))
205#endif
206#define SIGEV_MAX_SIZE 64
Christopher Ferris106b3a82016-08-24 12:15:38 -0700207#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE - __ARCH_SIGEV_PREAMBLE_SIZE) / sizeof(int))
Ben Cheng655a7c02013-10-16 16:09:24 -0700208typedef struct sigevent {
Tao Baod7db5942015-01-28 10:07:51 -0800209 sigval_t sigev_value;
210 int sigev_signo;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700211 int sigev_notify;
Tao Baod7db5942015-01-28 10:07:51 -0800212 union {
213 int _pad[SIGEV_PAD_SIZE];
214 int _tid;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700215 struct {
Tao Baod7db5942015-01-28 10:07:51 -0800216 void(* _function) (sigval_t);
217 void * _attribute;
218 } _sigev_thread;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700219 } _sigev_un;
Ben Cheng655a7c02013-10-16 16:09:24 -0700220} sigevent_t;
221#define sigev_notify_function _sigev_un._sigev_thread._function
222#define sigev_notify_attributes _sigev_un._sigev_thread._attribute
Christopher Ferris106b3a82016-08-24 12:15:38 -0700223#define sigev_notify_thread_id _sigev_un._tid
Ben Cheng655a7c02013-10-16 16:09:24 -0700224#endif