fix MINSIGSTKSZ values for archs with large signal contexts
[oweals/musl.git] / arch / mips / 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 long greg_t, gregset_t[32];
11 typedef struct {
12         union {
13                 double fp_dregs[32];
14                 struct {
15                         float _fp_fregs;
16                         unsigned _fp_pad;
17                 } fp_fregs[32];
18         } fp_r;
19 } fpregset_t;
20 struct sigcontext
21 {
22         unsigned sc_regmask, sc_status;
23         unsigned long long sc_pc, sc_regs[32], sc_fpregs[32];
24         unsigned sc_ownedfp, sc_fpc_csr, sc_fpc_eir, sc_used_math, sc_dsp;
25         unsigned long long sc_mdhi, sc_mdlo;
26         unsigned long sc_hi1, sc_lo1, sc_hi2, sc_lo2, sc_hi3, sc_lo3;
27 };
28 typedef struct
29 {
30         unsigned regmask, status;
31         unsigned long long pc, regs[32], fpregs[32];
32         unsigned ownedfp, fpc_csr, fpc_eir, used_math, dsp;
33         unsigned long long mdhi, mdlo;
34         unsigned long hi1, lo1, hi2, lo2, hi3, lo3;
35 } mcontext_t;
36 #else
37 typedef struct {
38         unsigned __mc1[2];
39         unsigned long long __mc2[65];
40         unsigned __mc3[5];
41         unsigned long long __mc4[2];
42         unsigned __mc5[6];
43 } mcontext_t;
44 #endif
45
46 struct sigaltstack {
47         void *ss_sp;
48         size_t ss_size;
49         int ss_flags;
50 };
51
52 typedef struct __ucontext {
53         unsigned long uc_flags;
54         struct __ucontext *uc_link;
55         stack_t uc_stack;
56         mcontext_t uc_mcontext;
57         sigset_t uc_sigmask;
58 } ucontext_t;
59
60 #define SA_NOCLDSTOP  1
61 #define SA_NOCLDWAIT  0x10000
62 #define SA_SIGINFO    8
63 #define SA_ONSTACK    0x08000000
64 #define SA_RESTART    0x10000000
65 #define SA_NODEFER    0x40000000
66 #define SA_RESETHAND  0x80000000
67 #define SA_RESTORER   0x04000000
68
69 #undef SIG_BLOCK
70 #undef SIG_UNBLOCK
71 #undef SIG_SETMASK
72 #define SIG_BLOCK     1
73 #define SIG_UNBLOCK   2
74 #define SIG_SETMASK   3
75
76 #endif
77
78 #define SIGHUP    1
79 #define SIGINT    2
80 #define SIGQUIT   3
81 #define SIGILL    4
82 #define SIGTRAP   5
83 #define SIGABRT   6
84 #define SIGIOT    SIGABRT
85 #define SIGSTKFLT 7
86 #define SIGFPE    8
87 #define SIGKILL   9
88 #define SIGBUS    10
89 #define SIGSEGV   11
90 #define SIGSYS    12
91 #define SIGPIPE   13
92 #define SIGALRM   14
93 #define SIGTERM   15
94 #define SIGUSR1   16
95 #define SIGUSR2   17
96 #define SIGCHLD   18
97 #define SIGPWR    19
98 #define SIGWINCH  20
99 #define SIGURG    21
100 #define SIGIO     22
101 #define SIGPOLL   SIGIO
102 #define SIGSTOP   23
103 #define SIGTSTP   24
104 #define SIGCONT   25
105 #define SIGTTIN   26
106 #define SIGTTOU   27
107 #define SIGVTALRM 28
108 #define SIGPROF   29
109 #define SIGXCPU   30
110 #define SIGXFSZ   31
111 #define SIGUNUSED SIGSYS
112
113 #define _NSIG 128