diff options
author | Warner Losh <imp@bsdimp.com> | 2021-11-12 21:55:59 -0700 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2021-11-23 01:47:01 +0100 |
commit | c6cda6a44a8adaeb30bd6dc185f021809625433d (patch) | |
tree | 89da6580df84c90fb5f843f99931bf6a0d421f3a /linux-user/host/x86_64 | |
parent | 6d9c9603ad2ffdbf2aae3f01955c17591287cb4c (diff) | |
download | qemu-c6cda6a44a8adaeb30bd6dc185f021809625433d.zip qemu-c6cda6a44a8adaeb30bd6dc185f021809625433d.tar.gz qemu-c6cda6a44a8adaeb30bd6dc185f021809625433d.tar.bz2 |
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/x86_64')
-rw-r--r-- | linux-user/host/x86_64/host-signal.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/linux-user/host/x86_64/host-signal.h b/linux-user/host/x86_64/host-signal.h index 883d2fc..c71d597 100644 --- a/linux-user/host/x86_64/host-signal.h +++ b/linux-user/host/x86_64/host-signal.h @@ -15,6 +15,11 @@ static inline uintptr_t host_signal_pc(ucontext_t *uc) return uc->uc_mcontext.gregs[REG_RIP]; } +static inline void host_signal_set_pc(ucontext_t *uc, uintptr_t pc) +{ + uc->uc_mcontext.gregs[REG_RIP] = pc; +} + static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc) { return uc->uc_mcontext.gregs[REG_TRAPNO] == 0xe |