mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
linux-user: Introduce host_sigcontext
Do not directly access ucontext_t as the third signal parameter. This is preparation for a sparc64 fix. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
@@ -11,17 +11,20 @@
|
||||
#ifndef MIPS_HOST_SIGNAL_H
|
||||
#define MIPS_HOST_SIGNAL_H
|
||||
|
||||
static inline uintptr_t host_signal_pc(ucontext_t *uc)
|
||||
/* The third argument to a SA_SIGINFO handler is ucontext_t. */
|
||||
typedef ucontext_t host_sigcontext;
|
||||
|
||||
static inline uintptr_t host_signal_pc(host_sigcontext *uc)
|
||||
{
|
||||
return uc->uc_mcontext.pc;
|
||||
}
|
||||
|
||||
static inline void host_signal_set_pc(ucontext_t *uc, uintptr_t pc)
|
||||
static inline void host_signal_set_pc(host_sigcontext *uc, uintptr_t pc)
|
||||
{
|
||||
uc->uc_mcontext.pc = pc;
|
||||
}
|
||||
|
||||
static inline void *host_signal_mask(ucontext_t *uc)
|
||||
static inline void *host_signal_mask(host_sigcontext *uc)
|
||||
{
|
||||
return &uc->uc_sigmask;
|
||||
}
|
||||
@@ -30,7 +33,7 @@ static inline void *host_signal_mask(ucontext_t *uc)
|
||||
#error "Unsupported encoding"
|
||||
#endif
|
||||
|
||||
static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc)
|
||||
static inline bool host_signal_write(siginfo_t *info, host_sigcontext *uc)
|
||||
{
|
||||
uint32_t insn = *(uint32_t *)host_signal_pc(uc);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user