2 * RISC-V signal definitions
4 * Copyright (c) 2019 Mark Corbin
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.
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.
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/>.
20 #ifndef TARGET_ARCH_SIGNAL_H
21 #define TARGET_ARCH_SIGNAL_H
26 #define TARGET_INSN_SIZE 4 /* riscv instruction size */
28 /* Size of the signal trampoline code placed on the stack. */
29 #define TARGET_SZSIGCODE ((abi_ulong)(7 * TARGET_INSN_SIZE))
31 /* Compare with riscv/include/_limits.h */
32 #define TARGET_MINSIGSTKSZ (1024 * 4)
33 #define TARGET_SIGSTKSZ (TARGET_MINSIGSTKSZ + 32768)
35 struct target_gpregs
{
47 struct target_fpregs
{
54 typedef struct target_mcontext
{
55 struct target_gpregs mc_gpregs
;
56 struct target_fpregs mc_fpregs
;
58 #define TARGET_MC_FP_VALID 0x01
63 #define TARGET_MCONTEXT_SIZE 864
64 #define TARGET_UCONTEXT_SIZE 936
66 #include "target_os_ucontext.h"
68 struct target_sigframe
{
69 target_ucontext_t sf_uc
; /* = *sf_uncontext */
70 target_siginfo_t sf_si
; /* = *sf_siginfo (SA_SIGINFO case)*/
73 #define TARGET_SIGSTACK_ALIGN 16
75 #endif /* TARGET_ARCH_SIGNAL_H */