[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/34] linux-user/include/host/sparc64: Fix host_sigcontext
From: |
Richard Henderson |
Subject: |
[PULL 05/34] linux-user/include/host/sparc64: Fix host_sigcontext |
Date: |
Fri, 11 Feb 2022 12:30:30 +1100 |
Sparc64 is unique on linux in *not* passing ucontext_t as
the third argument to a SA_SIGINFO handler. It passes the
old struct sigcontext instead.
Set both pc and npc in host_signal_set_pc.
Fixes: 8b5bd461935b ("linux-user/host/sparc: Populate host_signal.h")
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/include/host/sparc64/host-signal.h | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/linux-user/include/host/sparc64/host-signal.h
b/linux-user/include/host/sparc64/host-signal.h
index f8a8a4908d..64957c2bca 100644
--- a/linux-user/include/host/sparc64/host-signal.h
+++ b/linux-user/include/host/sparc64/host-signal.h
@@ -11,22 +11,23 @@
#ifndef SPARC64_HOST_SIGNAL_H
#define SPARC64_HOST_SIGNAL_H
-/* FIXME: the third argument to a SA_SIGINFO handler is *not* ucontext_t. */
-typedef ucontext_t host_sigcontext;
+/* The third argument to a SA_SIGINFO handler is struct sigcontext. */
+typedef struct sigcontext host_sigcontext;
-static inline uintptr_t host_signal_pc(host_sigcontext *uc)
+static inline uintptr_t host_signal_pc(host_sigcontext *sc)
{
- return uc->uc_mcontext.mc_gregs[MC_PC];
+ return sc->sigc_regs.tpc;
}
-static inline void host_signal_set_pc(host_sigcontext *uc, uintptr_t pc)
+static inline void host_signal_set_pc(host_sigcontext *sc, uintptr_t pc)
{
- uc->uc_mcontext.mc_gregs[MC_PC] = pc;
+ sc->sigc_regs.tpc = pc;
+ sc->sigc_regs.tnpc = pc + 4;
}
-static inline void *host_signal_mask(host_sigcontext *uc)
+static inline void *host_signal_mask(host_sigcontext *sc)
{
- return &uc->uc_sigmask;
+ return &sc->sigc_mask;
}
static inline bool host_signal_write(siginfo_t *info, host_sigcontext *uc)
--
2.25.1
- [PULL 00/34] tcg patch queue, Richard Henderson, 2022/02/10
- [PULL 01/34] common-user/host/sparc64: Fix safe_syscall_base, Richard Henderson, 2022/02/10
- [PULL 02/34] linux-user: Introduce host_signal_mask, Richard Henderson, 2022/02/10
- [PULL 03/34] linux-user: Introduce host_sigcontext, Richard Henderson, 2022/02/10
- [PULL 05/34] linux-user/include/host/sparc64: Fix host_sigcontext,
Richard Henderson <=
- [PULL 04/34] linux-user: Move sparc/host-signal.h to sparc64/host-signal.h, Richard Henderson, 2022/02/10
- [PULL 11/34] tcg/aarch64: Support raising sigbus for user-only, Richard Henderson, 2022/02/10
- [PULL 07/34] softmmu/cpus: Check if the cpu work list is empty atomically, Richard Henderson, 2022/02/10
- [PULL 08/34] replay: use CF_NOIRQ for special exception-replaying TB, Richard Henderson, 2022/02/10
- [PULL 06/34] accel/tcg: Optimize jump cache flush during tlb range flush, Richard Henderson, 2022/02/10
- [PULL 10/34] tcg/i386: Support raising sigbus for user-only, Richard Henderson, 2022/02/10
- [PULL 09/34] tcg/loongarch64: Fix fallout from recent MO_Q renaming, Richard Henderson, 2022/02/10
- [PULL 12/34] tcg/ppc: Support raising sigbus for user-only, Richard Henderson, 2022/02/10
- [PULL 15/34] tcg/tci: Support raising sigbus for user-only, Richard Henderson, 2022/02/10
- [PULL 14/34] tcg/s390x: Support raising sigbus for user-only, Richard Henderson, 2022/02/10