diff options
| author | Warner Losh | 2021-11-13 05:55:59 +0100 |
|---|---|---|
| committer | Richard Henderson | 2021-11-23 01:47:01 +0100 |
| commit | c6cda6a44a8adaeb30bd6dc185f021809625433d (patch) | |
| tree | 89da6580df84c90fb5f843f99931bf6a0d421f3a /linux-user/host/sparc | |
| parent | Merge tag 'pull-target-arm-20211122-1' of https://git.linaro.org/people/pmayd... (diff) | |
| download | qemu-c6cda6a44a8adaeb30bd6dc185f021809625433d.tar.gz qemu-c6cda6a44a8adaeb30bd6dc185f021809625433d.tar.xz qemu-c6cda6a44a8adaeb30bd6dc185f021809625433d.zip | |
linux-user: Add host_signal_set_pc to set pc in mcontext
Add a new function host_signal_set_pc to set the next pc in an
mcontext. The caller should ensure this is a valid PC for execution.
Acked-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20211113045603.60391-2-imp@bsdimp.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'linux-user/host/sparc')
| -rw-r--r-- | linux-user/host/sparc/host-signal.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/linux-user/host/sparc/host-signal.h b/linux-user/host/sparc/host-signal.h index 5e71d33f8e..7342936071 100644 --- a/linux-user/host/sparc/host-signal.h +++ b/linux-user/host/sparc/host-signal.h @@ -20,6 +20,15 @@ static inline uintptr_t host_signal_pc(ucontext_t *uc) #endif } +static inline void host_signal_set_pc(ucontext_t *uc, uintptr_t pc) +{ +#ifdef __arch64__ + uc->uc_mcontext.mc_gregs[MC_PC] = pc; +#else + uc->uc_mcontext.gregs[REG_PC] = pc; +#endif +} + static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc) { uint32_t insn = *(uint32_t *)host_signal_pc(uc); |
