fill in some missing siginfo stuff in signal.h
[musl] / arch / x86_64 / bits / signal.h
1 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2  || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
3
4 struct __fpstate {
5         unsigned long __x[4];
6         unsigned char __y[384];
7         unsigned long __z[12];
8 };
9
10 typedef struct {
11         unsigned long __gregs[23];
12         void *__fpregs;
13         unsigned long __reserved1[8];
14 } mcontext_t;
15
16 typedef struct __ucontext {
17         unsigned long uc_flags;
18         struct __ucontext *uc_link;
19         stack_t uc_stack;
20         mcontext_t uc_mcontext;
21         sigset_t uc_sigmask;
22         struct __fpstate __fpregs_mem;
23 } ucontext_t;
24
25 #ifdef _GNU_SOURCE
26 struct sigcontext {
27         unsigned long r8, r9, r10, r11, r12, r13, r14, r15;
28         unsigned long rdi, rsi, rbp, rbx, rdx, rax, rcx, rsp, rip, eflags;
29         unsigned short cs, gs, fs, __pad0;
30         unsigned long err, trapno, oldmask, cr2;
31         struct __fpstate *fpstate;
32         unsigned long __reserved1[8];
33 };
34 #endif
35
36 struct __siginfo
37 {
38         int si_signo;
39         int si_errno;
40         int si_code;
41         union
42         {
43                 int __pad[(128 - 4*sizeof(int)) / sizeof(int)];
44                 struct {
45                         pid_t si_pid;
46                         uid_t si_uid;
47                 } __kill;
48                 struct {
49                         void *si_timerid;
50                         int si_overrun;
51                         char __pad[sizeof(uid_t) - sizeof(int)];
52                         union sigval si_sigval;
53                         int si_private;
54                 } __timer;
55                 struct {
56                         pid_t si_pid;
57                         uid_t si_uid;
58                         union sigval si_sigval;
59                 } __rt;
60                 struct {
61                         pid_t si_pid;
62                         uid_t si_uid;
63                         int si_status;
64                         clock_t si_utime;
65                         clock_t si_stime;
66                 } __sigchld;
67                 struct {
68                         void *si_addr;
69                         short addr_lsb;
70                 } __sigfault;
71                 struct {
72                         long si_band;
73                         int si_fd;
74                 } __sigpoll;
75         } __si_fields;
76 };
77
78 #define si_pid     __si_fields.__sigchld.si_pid
79 #define si_uid     __si_fields.__sigchld.si_uid
80 #define si_status  __si_fields.__sigchld.si_status
81 #define si_utime   __si_fields.__sigchld.si_utime
82 #define si_stime   __si_fields.__sigchld.si_stime
83 #define si_value   __si_fields.__rt.si_sigval
84 #define si_addr    __si_fields.__sigfault.si_addr
85 #define si_band    __si_fields.__sigpoll.si_band
86
87 #define SI_ASYNCNL (-60)
88 #define SI_TKILL (-6)
89 #define SI_SIGIO (-5)
90 #define SI_ASYNCIO (-4)
91 #define SI_MESGQ (-3)
92 #define SI_TIMER (-2)
93 #define SI_QUEUE (-1)
94 #define SI_USER 0
95 #define SI_KERNEL 128
96
97 #define FPE_INTDIV 1
98 #define FPE_INTOVF 2
99 #define FPE_FLTDIV 3
100 #define FPE_FLTOVF 4
101 #define FPE_FLTUNT 5
102 #define FPE_FLTRES 6
103 #define FPE_FLTINV 7
104 #define FPE_FLTSUB 8
105
106 #define ILL_ILLOPC 1
107 #define ILL_ILLOPN 2
108 #define ILL_ILLADR 3
109 #define ILL_ILLTRP 4
110 #define ILL_PRVOPC 5
111 #define ILL_PRVREG 6
112 #define ILL_COPROC 7
113 #define ILL_BADSTK 8
114
115 #define SEGV_MAPERR 1
116 #define SEGV_ACCERR 2
117
118 #define BUS_ADRALN 1
119 #define BUS_ADRERR 2
120 #define BUS_OBJERR 3
121
122 #define CLD_EXITED 1
123 #define CLD_KILLED 2
124 #define CLD_DUMPED 3
125 #define CLD_TRAPPED 4
126 #define CLD_STOPPED 5
127 #define CLD_CONTINUED 6
128
129 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
130 #define TRAP_BRKPT 1
131 #define TRAP_TRACE 2
132 #define POLL_IN 1
133 #define POLL_OUT 2
134 #define POLL_MSG 3
135 #define POLL_ERR 4
136 #define POLL_PRI 5
137 #define POLL_HUP 6
138 #define SS_ONSTACK    1
139 #define SS_DISABLE    2
140 #endif
141
142 #define SA_NOCLDSTOP  1
143 #define SA_NOCLDWAIT  2
144 #define SA_SIGINFO    4
145 #define SA_ONSTACK    0x08000000
146 #define SA_RESTART    0x10000000
147 #define SA_NODEFER    0x40000000
148 #define SA_RESETHAND  0x80000000
149 #define SA_RESTORER   0x04000000
150
151 #define SIG_BLOCK     0
152 #define SIG_UNBLOCK   1
153 #define SIG_SETMASK   2
154
155 #endif
156
157 #ifdef _GNU_SOURCE
158 #define NSIG      64
159 #endif
160
161 #define SIG_ERR  ((void (*)(int))-1)
162 #define SIG_DFL  ((void (*)(int)) 0)
163 #define SIG_IGN  ((void (*)(int)) 1)
164 #define SIG_HOLD ((void (*)(int)) 2)
165
166 #define SIGHUP    1
167 #define SIGINT    2
168 #define SIGQUIT   3
169 #define SIGILL    4
170 #define SIGTRAP   5
171 #define SIGABRT   6
172 #define SIGBUS    7
173 #define SIGFPE    8
174 #define SIGKILL   9
175 #define SIGUSR1   10
176 #define SIGSEGV   11
177 #define SIGUSR2   12
178 #define SIGPIPE   13
179 #define SIGALRM   14
180 #define SIGTERM   15
181 #define SIGSTKFLT 16
182 #define SIGCHLD   17
183 #define SIGCONT   18
184 #define SIGSTOP   19
185 #define SIGTSTP   20
186 #define SIGTTIN   21
187 #define SIGTTOU   22
188 #define SIGURG    23
189 #define SIGXCPU   24
190 #define SIGXFSZ   25
191 #define SIGVTALRM 26
192 #define SIGPROF   27
193 #define SIGWINCH  28
194 #define SIGIO     29
195 #define SIGPOLL   29
196 #define SIGPWR    30
197 #define SIGSYS    31
198 #define SIGUNUSED SIGSYS