| 1 | /* |
| 2 | * arm signal definitions |
| 3 | * |
| 4 | * Copyright (c) 2013 Stacey D. Son |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 7 | */ |
| 8 | #ifndef TARGET_ARCH_SIGNAL_H |
| 9 | #define TARGET_ARCH_SIGNAL_H |
| 10 | |
| 11 | #include "cpu.h" |
| 12 | |
| 13 | #define TARGET_REG_R0 0 |
| 14 | #define TARGET_REG_R1 1 |
| 15 | #define TARGET_REG_R2 2 |
| 16 | #define TARGET_REG_R3 3 |
| 17 | #define TARGET_REG_R4 4 |
| 18 | #define TARGET_REG_R5 5 |
| 19 | #define TARGET_REG_R6 6 |
| 20 | #define TARGET_REG_R7 7 |
| 21 | #define TARGET_REG_R8 8 |
| 22 | #define TARGET_REG_R9 9 |
| 23 | #define TARGET_REG_R10 10 |
| 24 | #define TARGET_REG_R11 11 |
| 25 | #define TARGET_REG_R12 12 |
| 26 | #define TARGET_REG_R13 13 |
| 27 | #define TARGET_REG_R14 14 |
| 28 | #define TARGET_REG_R15 15 |
| 29 | #define TARGET_REG_CPSR 16 |
| 30 | #define TARGET__NGREG 17 |
| 31 | /* Convenience synonyms */ |
| 32 | #define TARGET_REG_FP TARGET_REG_R11 |
| 33 | #define TARGET_REG_SP TARGET_REG_R13 |
| 34 | #define TARGET_REG_LR TARGET_REG_R14 |
| 35 | #define TARGET_REG_PC TARGET_REG_R15 |
| 36 | |
| 37 | #define TARGET_INSN_SIZE 4 /* arm instruction size */ |
| 38 | |
| 39 | /* Size of the signal trampolin code. See _sigtramp(). */ |
| 40 | #define TARGET_SZSIGCODE ((abi_ulong)(9 * TARGET_INSN_SIZE)) |
| 41 | |
| 42 | /* compare to arm/include/_limits.h */ |
| 43 | #define TARGET_MINSIGSTKSZ (1024 * 4) /* min sig stack size */ |
| 44 | #define TARGET_SIGSTKSZ (TARGET_MINSIGSTKSZ + 32768) /* recommended size */ |
| 45 | |
| 46 | /* |
| 47 | * Floating point register state |
| 48 | */ |
| 49 | typedef struct target_mcontext_vfp { |
| 50 | abi_ullong mcv_reg[32]; |
| 51 | abi_ulong mcv_fpscr; |
| 52 | } target_mcontext_vfp_t; |
| 53 | |
| 54 | typedef struct target_mcontext { |
| 55 | abi_uint __gregs[TARGET__NGREG]; |
| 56 | |
| 57 | /* |
| 58 | * Originally, rest of this structure was named __fpu, 35 * 4 bytes |
| 59 | * long, never accessed from kernel. |
| 60 | */ |
| 61 | abi_ulong mc_vfp_size; |
| 62 | abi_ptr mc_vfp_ptr; |
| 63 | abi_int mc_spare[33]; |
| 64 | } target_mcontext_t; |
| 65 | |
| 66 | #define TARGET_MCONTEXT_SIZE 208 |
| 67 | #define TARGET_UCONTEXT_SIZE 260 |
| 68 | |
| 69 | #include "target_os_ucontext.h" |
| 70 | |
| 71 | struct target_sigframe { |
| 72 | target_siginfo_t sf_si; /* saved siginfo */ |
| 73 | target_ucontext_t sf_uc; /* saved ucontext */ |
| 74 | target_mcontext_vfp_t sf_vfp; /* actual saved VFP context */ |
| 75 | }; |
| 76 | |
| 77 | #define TARGET_SIGSTACK_ALIGN 8 |
| 78 | |
| 79 | #endif /* TARGET_ARCH_SIGNAL_H */ |