xref: /aosp_15_r20/external/musl/arch/loongarch64/bits/signal.h (revision c9945492fdd68bbe62686c5b452b4dc1be3f8453)
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 4096
6 #define SIGSTKSZ 16384
7 #endif
8 
9 #if defined(_GNU_SOURCE)
10 #define LARCH_NGREG 32
11 #define LARCH_REG_RA 1
12 #define LARCH_REG_SP 3
13 #define LARCH_REG_S0 23
14 #define LARCH_REG_S1 24
15 #define LARCH_REG_A0 4
16 #define LARCH_REG_S2 25
17 #define LARCH_REG_NARGS 8
18 #endif
19 
20 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
21 typedef unsigned long greg_t, gregset_t[32];
22 
23 struct sigcontext {
24 	unsigned long sc_pc;
25 	unsigned long sc_regs[32];
26 	unsigned sc_flags;
27 	unsigned long sc_extcontext[] __attribute__((__aligned__(16)));
28 };
29 #endif
30 
31 typedef struct {
32 	unsigned long __pc;
33 	unsigned long __gregs[32];
34 	unsigned __flags;
35 	unsigned long __extcontext[] __attribute__((__aligned__(16)));
36 } mcontext_t;
37 
38 struct sigaltstack {
39 	void *ss_sp;
40 	int ss_flags;
41 	size_t ss_size;
42 };
43 
44 typedef struct __ucontext
45 {
46 	unsigned long uc_flags;
47 	struct __ucontext *uc_link;
48 	stack_t uc_stack;
49 	sigset_t uc_sigmask;
50 	long __uc_pad;
51 	mcontext_t uc_mcontext;
52 } ucontext_t;
53 
54 #define __uc_flags uc_flags
55 
56 #define SA_NOCLDSTOP 1
57 #define SA_NOCLDWAIT 2
58 #define SA_SIGINFO   4
59 #define SA_ONSTACK   0x08000000
60 #define SA_RESTART   0x10000000
61 #define SA_NODEFER   0x40000000
62 #define SA_RESETHAND 0x80000000
63 
64 #endif
65 
66 #define SIGHUP     1
67 #define SIGINT     2
68 #define SIGQUIT    3
69 #define SIGILL     4
70 #define SIGTRAP    5
71 #define SIGABRT    6
72 #define SIGIOT     SIGABRT
73 #define SIGBUS     7
74 #define SIGFPE     8
75 #define SIGKILL    9
76 #define SIGUSR1   10
77 #define SIGSEGV   11
78 #define SIGUSR2   12
79 #define SIGPIPE   13
80 #define SIGALRM   14
81 #define SIGTERM   15
82 #define SIGSTKFLT 16
83 #define SIGCHLD   17
84 #define SIGCONT   18
85 #define SIGSTOP   19
86 #define SIGTSTP   20
87 #define SIGTTIN   21
88 #define SIGTTOU   22
89 #define SIGURG    23
90 #define SIGXCPU   24
91 #define SIGXFSZ   25
92 #define SIGVTALRM 26
93 #define SIGPROF   27
94 #define SIGWINCH  28
95 #define SIGIO     29
96 #define SIGPOLL   SIGIO
97 #define SIGPWR    30
98 #define SIGSYS    31
99 #define SIGUNUSED SIGSYS
100 
101 #define _NSIG 65
102