sigcontext/mcontext cleanup for arch-specific bits
[musl] / arch / x86_64 / bits / signal.h
1 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2  || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5 struct _fpstate {
6         unsigned short cwd, swd, ftw, fop;
7         unsigned long long rip, rdp;
8         unsigned mxcsr, mxcr_mask;
9         struct {
10                 unsigned short significand[4], exponent, padding[3];
11         } _st[8];
12         struct {
13                 unsigned element[4];
14         } _xmm[16];
15         unsigned padding[24];
16 };
17 struct sigcontext {
18         unsigned long r8, r9, r10, r11, r12, r13, r14, r15;
19         unsigned long rdi, rsi, rbp, rbx, rdx, rax, rcx, rsp, rip, eflags;
20         unsigned short cs, gs, fs, __pad0;
21         unsigned long err, trapno, oldmask, cr2;
22         struct _fpstate *fpstate;
23         unsigned long __reserved1[8];
24 };
25 typedef struct {
26         unsigned long long gregs[23];
27         struct _fpstate *fpregs;
28         unsigned long long __reserved1[8];
29 } mcontext_t;
30 #else
31 typedef struct {
32         unsigned long __space[32];
33 } mcontext_t;
34 #endif
35
36 typedef struct __ucontext {
37         unsigned long uc_flags;
38         struct __ucontext *uc_link;
39         stack_t uc_stack;
40         mcontext_t uc_mcontext;
41         sigset_t uc_sigmask;
42         unsigned long __fpregs_mem[64];
43 } ucontext_t;
44
45 #define SA_NOCLDSTOP  1
46 #define SA_NOCLDWAIT  2
47 #define SA_SIGINFO    4
48 #define SA_ONSTACK    0x08000000
49 #define SA_RESTART    0x10000000
50 #define SA_NODEFER    0x40000000
51 #define SA_RESETHAND  0x80000000
52 #define SA_RESTORER   0x04000000
53
54 #endif
55
56 #define SIGHUP    1
57 #define SIGINT    2
58 #define SIGQUIT   3
59 #define SIGILL    4
60 #define SIGTRAP   5
61 #define SIGABRT   6
62 #define SIGBUS    7
63 #define SIGFPE    8
64 #define SIGKILL   9
65 #define SIGUSR1   10
66 #define SIGSEGV   11
67 #define SIGUSR2   12
68 #define SIGPIPE   13
69 #define SIGALRM   14
70 #define SIGTERM   15
71 #define SIGSTKFLT 16
72 #define SIGCHLD   17
73 #define SIGCONT   18
74 #define SIGSTOP   19
75 #define SIGTSTP   20
76 #define SIGTTIN   21
77 #define SIGTTOU   22
78 #define SIGURG    23
79 #define SIGXCPU   24
80 #define SIGXFSZ   25
81 #define SIGVTALRM 26
82 #define SIGPROF   27
83 #define SIGWINCH  28
84 #define SIGIO     29
85 #define SIGPOLL   29
86 #define SIGPWR    30
87 #define SIGSYS    31
88 #define SIGUNUSED SIGSYS
89
90 #define _NSIG 65