[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 02/40] bsd-user: Create setup_sigframe_arch to setup sigframe
From: |
Warner Losh |
Subject: |
[PATCH v2 02/40] bsd-user: Create setup_sigframe_arch to setup sigframe context |
Date: |
Mon, 24 Jan 2022 18:29:09 -0700 |
Define setup_sigframe_arch whose job it is to setup the mcontext for the
sigframe. Implement for x86 to just call mcontext.
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/freebsd/target_os_signal.h | 3 +++
bsd-user/i386/signal.c | 13 +++++++++++++
bsd-user/x86_64/signal.c | 13 +++++++++++++
3 files changed, 29 insertions(+)
diff --git a/bsd-user/freebsd/target_os_signal.h
b/bsd-user/freebsd/target_os_signal.h
index 3ed454e086d..7491629477a 100644
--- a/bsd-user/freebsd/target_os_signal.h
+++ b/bsd-user/freebsd/target_os_signal.h
@@ -4,6 +4,9 @@
#include "target_os_siginfo.h"
#include "target_arch_signal.h"
+abi_long setup_sigframe_arch(CPUArchState *regs, abi_ulong frame_addr,
+ struct target_sigframe *frame, int flags);
+
/* Compare to sys/signal.h */
#define TARGET_SIGHUP 1 /* hangup */
#define TARGET_SIGINT 2 /* interrupt */
diff --git a/bsd-user/i386/signal.c b/bsd-user/i386/signal.c
index 2939d32400c..5dd975ce56a 100644
--- a/bsd-user/i386/signal.c
+++ b/bsd-user/i386/signal.c
@@ -32,6 +32,19 @@ abi_long set_sigtramp_args(CPUX86State *env, int sig,
return 0;
}
+/*
+ * Compare to i386/i386/exec_machdep.c sendsig()
+ * Assumes that the memory is locked if frame points to user memory.
+ */
+abi_long setup_sigframe_arch(CPUX86State *env, abi_ulong frame_addr,
+ struct target_sigframe *frame, int flags)
+{
+ target_mcontext_t *mcp = &frame->sf_uc.uc_mcontext;
+
+ get_mcontext(env, mcp, flags);
+ return 0;
+}
+
/* Compare to i386/i386/machdep.c get_mcontext() */
abi_long get_mcontext(CPUX86State *regs, target_mcontext_t *mcp, int flags)
{
diff --git a/bsd-user/x86_64/signal.c b/bsd-user/x86_64/signal.c
index 8885152a7da..c3875bc4c6a 100644
--- a/bsd-user/x86_64/signal.c
+++ b/bsd-user/x86_64/signal.c
@@ -30,6 +30,19 @@ abi_long set_sigtramp_args(CPUX86State *regs,
return 0;
}
+/*
+ * Compare to amd64/amd64/exec_machdep.c sendsig()
+ * Assumes that the memory is locked if frame points to user memory.
+ */
+abi_long setup_sigframe_arch(CPUX86State *env, abi_ulong frame_addr,
+ struct target_sigframe *frame, int flags)
+{
+ target_mcontext_t *mcp = &frame->sf_uc.uc_mcontext;
+
+ get_mcontext(env, mcp, flags);
+ return 0;
+}
+
/* Compare to amd64/amd64/machdep.c get_mcontext() */
abi_long get_mcontext(CPUX86State *regs,
target_mcontext_t *mcp, int flags)
--
2.33.1
- [PATCH v2 00/40] bsd-user: upstream our signal implementation, Warner Losh, 2022/01/24
- [PATCH v2 03/40] bsd-user/arm/signal.c: Implement setup_sigframe_arch for arm, Warner Losh, 2022/01/24
- [PATCH v2 01/40] bsd-user: Complete FreeBSD siginfo, Warner Losh, 2022/01/24
- [PATCH v2 02/40] bsd-user: Create setup_sigframe_arch to setup sigframe context,
Warner Losh <=
- [PATCH v2 04/40] bsd-user/arm/signal.c: get_mcontext should zero vfp data, Warner Losh, 2022/01/24
- [PATCH v2 05/40] bsd-user: Remove vestiges of signal queueing code, Warner Losh, 2022/01/24
- [PATCH v2 06/40] bsd-user: Bring in docs from linux-user for signal_pending, Warner Losh, 2022/01/24
- [PATCH v2 07/40] bsd-user/arm/target_arch_cpu.h: Move EXCP_ATOMIC to match linux-user, Warner Losh, 2022/01/24
- [PATCH v2 08/40] bsd-user/signal.c: implement force_sig_fault, Warner Losh, 2022/01/24