03fe48c150beebe4d90b780b6d65539b6710c1d2
[musl] / arch / riscv64 / 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(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5 # define MINSIGSTKSZ 2048
6 # define SIGSTKSZ 8192
7 #endif
8
9 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10 typedef unsigned long greg_t;
11 typedef unsigned long gregset_t[32];
12 typedef union __riscv_mc_fp_state fpregset_t;
13 #endif
14
15 typedef unsigned long __riscv_mc_gp_state[32];
16
17 struct __riscv_mc_f_ext_state {
18         unsigned int __f[32];
19         unsigned int __fcsr;
20 };
21
22 struct __riscv_mc_d_ext_state {
23         unsigned long long __f[32];
24         unsigned int __fcsr;
25 };
26
27 struct __riscv_mc_q_ext_state {
28         unsigned long long __f[64] __attribute__((aligned(16)));
29         unsigned int __fcsr;
30         unsigned int __reserved[3];
31 };
32
33 union __riscv_mc_fp_state {
34         struct __riscv_mc_f_ext_state __f;
35         struct __riscv_mc_d_ext_state __d;
36         struct __riscv_mc_q_ext_state __q;
37 };
38
39 typedef struct mcontext_t {
40         __riscv_mc_gp_state __gregs;
41         union __riscv_mc_fp_state __fpregs;
42 } mcontext_t;
43
44 struct sigaltstack {
45         void *ss_sp;
46         int ss_flags;
47         size_t ss_size;
48 };
49
50 typedef struct ucontext_t
51 {
52         unsigned long uc_flags;
53         struct ucontext_t *uc_link;
54         stack_t uc_stack;
55         sigset_t uc_sigmask;
56         mcontext_t uc_mcontext;
57 } ucontext_t;
58
59 #define SA_NOCLDSTOP 1
60 #define SA_NOCLDWAIT 2
61 #define SA_SIGINFO   4
62 #define SA_ONSTACK   0x08000000
63 #define SA_RESTART   0x10000000
64 #define SA_NODEFER   0x40000000
65 #define SA_RESETHAND 0x80000000
66 #define SA_RESTORER  0x04000000
67
68 #endif
69
70 #define SIGHUP     1
71 #define SIGINT     2
72 #define SIGQUIT    3
73 #define SIGILL     4
74 #define SIGTRAP    5
75 #define SIGABRT    6
76 #define SIGIOT     SIGABRT
77 #define SIGBUS     7
78 #define SIGFPE     8
79 #define SIGKILL    9
80 #define SIGUSR1   10
81 #define SIGSEGV   11
82 #define SIGUSR2   12
83 #define SIGPIPE   13
84 #define SIGALRM   14
85 #define SIGTERM   15
86 #define SIGSTKFLT 16
87 #define SIGCHLD   17
88 #define SIGCONT   18
89 #define SIGSTOP   19
90 #define SIGTSTP   20
91 #define SIGTTIN   21
92 #define SIGTTOU   22
93 #define SIGURG    23
94 #define SIGXCPU   24
95 #define SIGXFSZ   25
96 #define SIGVTALRM 26
97 #define SIGPROF   27
98 #define SIGWINCH  28
99 #define SIGIO     29
100 #define SIGPOLL   SIGIO
101 #define SIGPWR    30
102 #define SIGSYS    31
103 #define SIGUNUSED SIGSYS
104
105 #define _NSIG     65