xref: /qemu/bsd-user/arm/target_arch_signal.h (revision b83a80e8)
1 /*
2  *  arm signal definitions
3  *
4  *  Copyright (c) 2013 Stacey D. Son
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef _TARGET_ARCH_SIGNAL_H_
20 #define _TARGET_ARCH_SIGNAL_H_
21 
22 #include "cpu.h"
23 
24 #define TARGET_REG_R0   0
25 #define TARGET_REG_R1   1
26 #define TARGET_REG_R2   2
27 #define TARGET_REG_R3   3
28 #define TARGET_REG_R4   4
29 #define TARGET_REG_R5   5
30 #define TARGET_REG_R6   6
31 #define TARGET_REG_R7   7
32 #define TARGET_REG_R8   8
33 #define TARGET_REG_R9   9
34 #define TARGET_REG_R10  10
35 #define TARGET_REG_R11  11
36 #define TARGET_REG_R12  12
37 #define TARGET_REG_R13  13
38 #define TARGET_REG_R14  14
39 #define TARGET_REG_R15  15
40 #define TARGET_REG_CPSR 16
41 #define TARGET__NGREG   17
42 /* Convenience synonyms */
43 #define TARGET_REG_FP   TARGET_REG_R11
44 #define TARGET_REG_SP   TARGET_REG_R13
45 #define TARGET_REG_LR   TARGET_REG_R14
46 #define TARGET_REG_PC   TARGET_REG_R15
47 
48 #define TARGET_INSN_SIZE    4       /* arm instruction size */
49 
50 /* Size of the signal trampolin code. See _sigtramp(). */
51 #define TARGET_SZSIGCODE    ((abi_ulong)(9 * TARGET_INSN_SIZE))
52 
53 /* compare to arm/include/_limits.h */
54 #define TARGET_MINSIGSTKSZ  (1024 * 4)                  /* min sig stack size */
55 #define TARGET_SIGSTKSZ     (TARGET_MINSIGSTKSZ + 32768)  /* recommended size */
56 
57 /*
58  * Floating point register state
59  */
60 typedef struct target_mcontext_vfp {
61     abi_ullong  mcv_reg[32];
62     abi_ulong   mcv_fpscr;
63 } target_mcontext_vfp_t;
64 
65 typedef struct target_mcontext {
66     abi_uint    __gregs[TARGET__NGREG];
67 
68     /*
69      * Originally, rest of this structure was named __fpu, 35 * 4 bytes
70      * long, never accessed from kernel.
71      */
72     abi_ulong   mc_vfp_size;
73     abi_ptr     mc_vfp_ptr;
74     abi_int     mc_spare[33];
75 } target_mcontext_t;
76 
77 #define TARGET_MCONTEXT_SIZE 208
78 #define TARGET_UCONTEXT_SIZE 260
79 
80 #include "target_os_ucontext.h"
81 
82 struct target_sigframe {
83     target_siginfo_t    sf_si;  /* saved siginfo */
84     target_ucontext_t   sf_uc;  /* saved ucontext */
85     target_mcontext_vfp_t sf_vfp; /* actual saved VFP context */
86 };
87 
88 #endif /* !_TARGET_ARCH_SIGNAL_H_ */
89