1 /**************************************************************************** 2 Derived from platforms/android-14/arch-arm/usr/include/asm-generic/siginfo.h 3 **************************************************************************** 4 *** 5 *** This header was automatically generated from a Linux kernel header 6 *** of the same name, to make information necessary for userspace to 7 *** call into the kernel available to libc. It contains only constants, 8 *** structures, and macros generated from the original header, and thus, 9 *** contains no copyrightable information. 10 *** 11 **************************************************************************** 12 ****************************************************************************/ 13 #ifndef _ASM_PORTABLE_GENERIC_SIGINFO_H 14 #define _ASM_PORTABLE_GENERIC_SIGINFO_H 15 16 #include <linux/compiler.h> 17 #include <linux/types.h> 18 19 typedef union sigval_portable { 20 int sival_int; 21 void __user *sival_ptr; 22 } sigval_portable_t; 23 24 #ifndef __ARCH_SI_PREAMBLE_SIZE 25 #define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int)) 26 #endif 27 28 #define SI_MAX_SIZE 128 29 #ifndef SI_PAD_SIZE 30 #define SI_PAD_SIZE ((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof(int)) 31 #endif 32 33 #ifndef __ARCH_SI_UID_T 34 #define __ARCH_SI_UID_T uid_t 35 #endif 36 37 #ifndef __ARCH_SI_BAND_T 38 #define __ARCH_SI_BAND_T long 39 #endif 40 41 typedef struct siginfo_portable { 42 int si_signo; 43 int si_errno; 44 int si_code; 45 46 union { 47 int _pad[SI_PAD_SIZE]; 48 49 struct { 50 pid_t _pid; 51 __ARCH_SI_UID_T _uid; 52 } _kill; 53 54 struct { 55 timer_t _tid; 56 int _overrun; 57 char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)]; 58 sigval_portable_t _sigval; 59 int _sys_private; 60 } _timer; 61 62 struct { 63 pid_t _pid; 64 __ARCH_SI_UID_T _uid; 65 sigval_t _sigval; 66 } _rt; 67 68 struct { 69 pid_t _pid; 70 __ARCH_SI_UID_T _uid; 71 int _status; 72 clock_t _utime; 73 clock_t _stime; 74 } _sigchld; 75 76 struct { 77 void __user *_addr; 78 #ifdef __ARCH_SI_TRAPNO 79 int _trapno; 80 #endif 81 } _sigfault; 82 83 struct { 84 __ARCH_SI_BAND_T _band; 85 int _fd; 86 } _sigpoll; 87 88 } _sifields; 89 } siginfo_portable_t; 90 91 #ifndef si_pid 92 #define si_pid _sifields._kill._pid 93 #define si_uid _sifields._kill._uid 94 #define si_tid _sifields._timer._tid 95 #define si_overrun _sifields._timer._overrun 96 #define si_sys_private _sifields._timer._sys_private 97 #define si_status _sifields._sigchld._status 98 #define si_utime _sifields._sigchld._utime 99 #define si_stime _sifields._sigchld._stime 100 #define si_value _sifields._rt._sigval 101 #define si_int _sifields._rt._sigval.sival_int 102 #define si_ptr _sifields._rt._sigval.sival_ptr 103 #define si_addr _sifields._sigfault._addr 104 #ifdef __ARCH_SI_TRAPNO 105 #define si_trapno _sifields._sigfault._trapno 106 #endif 107 #define si_band _sifields._sigpoll._band 108 #define si_fd _sifields._sigpoll._fd 109 #endif 110 111 #ifndef __SI_KILL 112 #define __SI_KILL 0 113 #define __SI_TIMER 0 114 #define __SI_POLL 0 115 #define __SI_FAULT 0 116 #define __SI_CHLD 0 117 #define __SI_RT 0 118 #define __SI_MESGQ 0 119 #define __SI_CODE(T,N) (N) 120 #endif 121 122 #ifndef SI_USER 123 #define SI_USER 0 124 #define SI_KERNEL 0x80 125 #define SI_QUEUE -1 126 #define SI_TIMER __SI_CODE(__SI_TIMER,-2) 127 #define SI_MESGQ __SI_CODE(__SI_MESGQ,-3) 128 #define SI_ASYNCIO -4 129 #define SI_SIGIO -5 130 #define SI_TKILL -6 131 #define SI_DETHREAD -7 132 133 #define SI_FROMUSER(siptr) ((siptr)->si_code <= 0) 134 #define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0) 135 #endif 136 137 #ifndef ILL_ILLOPC 138 #define ILL_ILLOPC (__SI_FAULT|1) 139 #define ILL_ILLOPN (__SI_FAULT|2) 140 #define ILL_ILLADR (__SI_FAULT|3) 141 #define ILL_ILLTRP (__SI_FAULT|4) 142 #define ILL_PRVOPC (__SI_FAULT|5) 143 #define ILL_PRVREG (__SI_FAULT|6) 144 #define ILL_COPROC (__SI_FAULT|7) 145 #define ILL_BADSTK (__SI_FAULT|8) 146 #define NSIGILL 8 147 #endif 148 149 #ifndef FPE_INTDIV 150 #define FPE_INTDIV (__SI_FAULT|1) 151 #define FPE_INTOVF (__SI_FAULT|2) 152 #define FPE_FLTDIV (__SI_FAULT|3) 153 #define FPE_FLTOVF (__SI_FAULT|4) 154 #define FPE_FLTUND (__SI_FAULT|5) 155 #define FPE_FLTRES (__SI_FAULT|6) 156 #define FPE_FLTINV (__SI_FAULT|7) 157 #define FPE_FLTSUB (__SI_FAULT|8) 158 #define NSIGFPE 8 159 160 #define SEGV_MAPERR (__SI_FAULT|1) 161 #define SEGV_ACCERR (__SI_FAULT|2) 162 #define NSIGSEGV 2 163 164 #define BUS_ADRALN (__SI_FAULT|1) 165 #define BUS_ADRERR (__SI_FAULT|2) 166 #define BUS_OBJERR (__SI_FAULT|3) 167 #define NSIGBUS 3 168 169 #define TRAP_BRKPT (__SI_FAULT|1) 170 #define TRAP_TRACE (__SI_FAULT|2) 171 #define NSIGTRAP 2 172 173 #define CLD_EXITED (__SI_CHLD|1) 174 #define CLD_KILLED (__SI_CHLD|2) 175 #define CLD_DUMPED (__SI_CHLD|3) 176 #define CLD_TRAPPED (__SI_CHLD|4) 177 #define CLD_STOPPED (__SI_CHLD|5) 178 #define CLD_CONTINUED (__SI_CHLD|6) 179 #define NSIGCHLD 6 180 181 #define POLL_IN (__SI_POLL|1) 182 #define POLL_OUT (__SI_POLL|2) 183 #define POLL_MSG (__SI_POLL|3) 184 #define POLL_ERR (__SI_POLL|4) 185 #define POLL_PRI (__SI_POLL|5) 186 #define POLL_HUP (__SI_POLL|6) 187 #define NSIGPOLL 6 188 189 #define SIGEV_SIGNAL 0 190 #define SIGEV_NONE 1 191 #define SIGEV_THREAD 2 192 #define SIGEV_THREAD_ID 4 193 #endif /* FPE_INTDIV */ 194 195 #ifndef __ARCH_SIGEV_PREAMBLE_SIZE 196 #define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(int) * 2 + sizeof(sigval_portable_t)) 197 #endif 198 199 #define SIGEV_MAX_SIZE 64 200 #define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE - __ARCH_SIGEV_PREAMBLE_SIZE) / sizeof(int)) 201 202 typedef struct sigevent_portable { 203 sigval_portable_t sigev_value; 204 int sigev_signo; 205 int sigev_notify; 206 union { 207 int _pad[SIGEV_PAD_SIZE]; 208 int _tid; 209 210 struct { 211 void (*_function)(sigval_portable_t); 212 void *_attribute; 213 } _sigev_thread; 214 } _sigev_un; 215 } sigevent_portable_t; 216 217 #define sigev_notify_function _sigev_un._sigev_thread._function 218 #define sigev_notify_attributes _sigev_un._sigev_thread._attribute 219 #define sigev_notify_thread_id _sigev_un._tid 220 221 #endif 222