[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 17/29] bsd-user/freebsd: Create common target_os_ucontext.h fi
From: |
Warner Losh |
Subject: |
[PATCH v3 17/29] bsd-user/freebsd: Create common target_os_ucontext.h file |
Date: |
Thu, 4 Nov 2021 08:05:24 -0600 |
FreeBSD has a MI ucontext structure that contains the MD mcontext
machine state and other things that are machine independent. Create an
include file for all the ucontext stuff. It needs to be included in the
arch specific files after target_mcontext is defined. This is largely
copied from sys/_ucontext.h with the comments about layout removed
because we don't support ancient FreeBSD binaries.
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
bsd-user/freebsd/target_os_signal.h | 3 ---
bsd-user/freebsd/target_os_ucontext.h | 26 ++++++++++++++++++++++++++
2 files changed, 26 insertions(+), 3 deletions(-)
create mode 100644 bsd-user/freebsd/target_os_ucontext.h
diff --git a/bsd-user/freebsd/target_os_signal.h
b/bsd-user/freebsd/target_os_signal.h
index 1a4c5faf19..3ed454e086 100644
--- a/bsd-user/freebsd/target_os_signal.h
+++ b/bsd-user/freebsd/target_os_signal.h
@@ -1,9 +1,6 @@
#ifndef _TARGET_OS_SIGNAL_H_
#define _TARGET_OS_SIGNAL_H_
-/* FreeBSD's sys/ucontext.h defines this */
-#define TARGET_MC_GET_CLEAR_RET 0x0001
-
#include "target_os_siginfo.h"
#include "target_arch_signal.h"
diff --git a/bsd-user/freebsd/target_os_ucontext.h
b/bsd-user/freebsd/target_os_ucontext.h
new file mode 100644
index 0000000000..20b8a9188e
--- /dev/null
+++ b/bsd-user/freebsd/target_os_ucontext.h
@@ -0,0 +1,26 @@
+/*
+ * FreeBSD has a common ucontext definition for all architectures.
+ *
+ * Copyright 2021 Warner Losh <imp@bsdimp.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause
+ */
+
+/*
+ * Defines the common bits for all of FreeBSD's architectures. Has to be
+ * included AFTER the MD target_mcontext_t is defined, however, so can't
+ * be in the grab-bag that is target_os_signal.h.
+ */
+
+/* See FreeBSD's sys/ucontext.h */
+#define TARGET_MC_GET_CLEAR_RET 0x0001
+
+/* FreeBSD's sys/_ucontext.h structures */
+typedef struct target_ucontext {
+ target_sigset_t uc_sigmask;
+ target_mcontext_t uc_mcontext;
+ abi_ulong uc_link;
+ target_stack_t uc_stack;
+ int32_t uc_flags;
+ int32_t __spare__[4];
+} target_ucontext_t;
--
2.33.0
- [PATCH v3 07/29] bsd-user/arm/target_arch_cpu.h: Implement trivial EXCP exceptions, (continued)
- [PATCH v3 07/29] bsd-user/arm/target_arch_cpu.h: Implement trivial EXCP exceptions, Warner Losh, 2021/11/04
- [PATCH v3 08/29] bsd-user/arm/target_arch_cpu.h: Implement data abort exceptions, Warner Losh, 2021/11/04
- [PATCH v3 10/29] bsd-user/arm/target_arch_reg.h: Implement core dump register copying, Warner Losh, 2021/11/04
- [PATCH v3 11/29] bsd-user/arm/target_arch_vmparam.h: Parameters for arm address space, Warner Losh, 2021/11/04
- [PATCH v3 09/29] bsd-user/arm/target_arch_cpu.h: Implement system call dispatch, Warner Losh, 2021/11/04
- [PATCH v3 16/29] bsd-user/arm/target_arch_elf.h: arm get_hwcap2 impl, Warner Losh, 2021/11/04
- [PATCH v3 12/29] bsd-user/arm/target_arch_sigtramp.h: Signal Trampoline for arm, Warner Losh, 2021/11/04
- [PATCH v3 14/29] bsd-user/arm/target_arch_elf.h: arm defines for ELF, Warner Losh, 2021/11/04
- [PATCH v3 13/29] bsd-user/arm/target_arch_thread.h: Routines to create and switch to a thread, Warner Losh, 2021/11/04
- [PATCH v3 17/29] bsd-user/freebsd: Create common target_os_ucontext.h file,
Warner Losh <=
- [PATCH v3 19/29] bsd-user/arm/target_arch_signal.h: arm machine context for signals, Warner Losh, 2021/11/04
- [PATCH v3 21/29] bsd-user/arm/target_arch_signal.h: arm set_sigtramp_args, Warner Losh, 2021/11/04
- [PATCH v3 18/29] bsd-user/arm/target_arch_signal.h: arm specific signal registers and stack, Warner Losh, 2021/11/04
- [PATCH v3 22/29] bsd-user/arm/target_arch_signal.h: arm get_mcontext, Warner Losh, 2021/11/04
- [PATCH v3 15/29] bsd-user/arm/target_arch_elf.h: arm get hwcap, Warner Losh, 2021/11/04
- [PATCH v3 20/29] bsd-user/arm/target_arch_signal.h: arm user context and trapframe for signals, Warner Losh, 2021/11/04