2 * host-signal.h: signal info dependent on the host architecture
4 * Copyright (c) 2021 Warner Losh
6 * SPDX-License-Identifier: GPL-2.0-or-later
9 #ifndef ARM_HOST_SIGNAL_H
10 #define ARM_HOST_SIGNAL_H
12 #include <sys/ucontext.h>
14 static inline uintptr_t host_signal_pc(ucontext_t *uc)
16 return uc->uc_mcontext.__gregs[_REG_PC];
19 static inline void host_signal_set_pc(ucontext_t *uc, uintptr_t pc)
21 uc->uc_mcontext.__gregs[_REG_PC] = pc;
24 static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc)
27 * In the FSR, bit 11 is WnR. FreeBSD returns this as part of the
30 uint32_t fsr = info->si_trapno;
32 return extract32(fsr, 11, 1);