aboutsummaryrefslogtreecommitdiff
path: root/linux-user/host/x86_64
diff options
context:
space:
mode:
authorWarner Losh <imp@bsdimp.com>2021-11-12 21:56:00 -0700
committerRichard Henderson <richard.henderson@linaro.org>2021-11-23 01:47:20 +0100
commit07637888687bfecf3c0cc8351c5c24f29a611691 (patch)
tree516c155aa936626c6d3dbe0494b1e950974f2ad7 /linux-user/host/x86_64
parentc6cda6a44a8adaeb30bd6dc185f021809625433d (diff)
downloadqemu-07637888687bfecf3c0cc8351c5c24f29a611691.zip
qemu-07637888687bfecf3c0cc8351c5c24f29a611691.tar.gz
qemu-07637888687bfecf3c0cc8351c5c24f29a611691.tar.bz2
linux-user/signal.c: Create a common rewind_if_in_safe_syscall
All instances of rewind_if_in_safe_syscall are the same, differing only in how the instruction point is fetched from the ucontext and the size of the registers. Use host_signal_pc and new host_signal_set_pc interfaces to fetch the pointer to the PC and adjust if needed. Delete all the old copies of rewind_if_in_safe_syscall. Acked-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20211113045603.60391-3-imp@bsdimp.com> [rth: include safe-syscall.h, simplify ifdefs] Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'linux-user/host/x86_64')
-rw-r--r--linux-user/host/x86_64/hostdep.h20
1 files changed, 0 insertions, 20 deletions
diff --git a/linux-user/host/x86_64/hostdep.h b/linux-user/host/x86_64/hostdep.h
index a4fefb5..9c62bd2 100644
--- a/linux-user/host/x86_64/hostdep.h
+++ b/linux-user/host/x86_64/hostdep.h
@@ -15,24 +15,4 @@
/* We have a safe-syscall.inc.S */
#define HAVE_SAFE_SYSCALL
-#ifndef __ASSEMBLER__
-
-/* These are defined by the safe-syscall.inc.S file */
-extern char safe_syscall_start[];
-extern char safe_syscall_end[];
-
-/* Adjust the signal context to rewind out of safe-syscall if we're in it */
-static inline void rewind_if_in_safe_syscall(void *puc)
-{
- ucontext_t *uc = puc;
- greg_t *pcreg = &uc->uc_mcontext.gregs[REG_RIP];
-
- if (*pcreg > (uintptr_t)safe_syscall_start
- && *pcreg < (uintptr_t)safe_syscall_end) {
- *pcreg = (uintptr_t)safe_syscall_start;
- }
-}
-
-#endif /* __ASSEMBLER__ */
-
#endif