[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 19/40] bsd-user/host/arm/host-signal.h: Implement host_signal_*
From: |
Warner Losh |
Subject: |
[PULL 19/40] bsd-user/host/arm/host-signal.h: Implement host_signal_* |
Date: |
Mon, 31 Jan 2022 12:56:15 -0700 |
Implement host_signal_pc, host_signal_set_pc and host_signal_write for
arm.
Signed-off-by: Kyle Evans <kevans@freebsd.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
bsd-user/host/arm/host-signal.h | 35 +++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 bsd-user/host/arm/host-signal.h
diff --git a/bsd-user/host/arm/host-signal.h b/bsd-user/host/arm/host-signal.h
new file mode 100644
index 00000000000..56679bd6993
--- /dev/null
+++ b/bsd-user/host/arm/host-signal.h
@@ -0,0 +1,35 @@
+/*
+ * host-signal.h: signal info dependent on the host architecture
+ *
+ * Copyright (c) 2021 Warner Losh
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef ARM_HOST_SIGNAL_H
+#define ARM_HOST_SIGNAL_H
+
+#include <sys/ucontext.h>
+
+static inline uintptr_t host_signal_pc(ucontext_t *uc)
+{
+ return uc->uc_mcontext.__gregs[_REG_PC];
+}
+
+static inline void host_signal_set_pc(ucontext_t *uc, uintptr_t pc)
+{
+ uc->uc_mcontext.__gregs[_REG_PC] = pc;
+}
+
+static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc)
+{
+ /*
+ * In the FSR, bit 11 is WnR. FreeBSD returns this as part of the
+ * si_info.si_trapno.
+ */
+ uint32_t fsr = info->si_trapno;
+
+ return extract32(fsr, 11, 1);
+}
+
+#endif
--
2.33.1
- [PULL 00/40] Bsd user arm 2022q1 patches, Warner Losh, 2022/01/31
- [PULL 01/40] bsd-user: Complete FreeBSD siginfo, Warner Losh, 2022/01/31
- [PULL 06/40] bsd-user: Bring in docs from linux-user for signal_pending, Warner Losh, 2022/01/31
- [PULL 10/40] bsd-user/signal.c: Implement cpu_loop_exit_sigsegv, Warner Losh, 2022/01/31
- [PULL 07/40] bsd-user/arm/target_arch_cpu.h: Move EXCP_ATOMIC to match linux-user, Warner Losh, 2022/01/31
- [PULL 36/40] bsd-user/signal.c: implement do_sigaction, Warner Losh, 2022/01/31
- [PULL 37/40] bsd-user/signal.c: do_sigaltstack, Warner Losh, 2022/01/31
- [PULL 29/40] bsd-user/signal.c: Fill in queue_signal, Warner Losh, 2022/01/31
- [PULL 35/40] bsd-user/signal.c: implement do_sigreturn, Warner Losh, 2022/01/31
- [PULL 04/40] bsd-user/arm/signal.c: get_mcontext should zero vfp data, Warner Losh, 2022/01/31
- [PULL 19/40] bsd-user/host/arm/host-signal.h: Implement host_signal_*,
Warner Losh <=
- [PULL 11/40] bsd-user/signal.c: implement cpu_loop_exit_sigbus, Warner Losh, 2022/01/31
- [PULL 05/40] bsd-user: Remove vestiges of signal queueing code, Warner Losh, 2022/01/31
- [PULL 12/40] bsd-user/arm/arget_arch_cpu.h: Move EXCP_DEBUG and EXCP_BKPT together, Warner Losh, 2022/01/31
- [PULL 14/40] bsd-user/arm/target_arch_cpu.h: Use force_sig_fault for EXCP_UDEF, Warner Losh, 2022/01/31
- [PULL 21/40] bsd-user/host/x86_64/host-signal.h: Implement host_signal_*, Warner Losh, 2022/01/31
- [PULL 30/40] bsd-user/signal.c: sigset manipulation routines., Warner Losh, 2022/01/31
- [PULL 39/40] bsd-user: Rename arg name for target_cpu_reset to env, Warner Losh, 2022/01/31
- [PULL 26/40] bsd-user/signal.c: Implement host_signal_handler, Warner Losh, 2022/01/31
- [PULL 23/40] bsd-user: Add trace events for bsd-user, Warner Losh, 2022/01/31
- [PULL 31/40] bsd-user/signal.c: setup_frame, Warner Losh, 2022/01/31