From c6cda6a44a8adaeb30bd6dc185f021809625433d Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 12 Nov 2021 21:55:59 -0700 Subject: 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 Signed-off-by: Warner Losh Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20211113045603.60391-2-imp@bsdimp.com> Signed-off-by: Richard Henderson --- linux-user/host/arm/host-signal.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'linux-user/host/arm') diff --git a/linux-user/host/arm/host-signal.h b/linux-user/host/arm/host-signal.h index efb165c0c5..6c095773c0 100644 --- a/linux-user/host/arm/host-signal.h +++ b/linux-user/host/arm/host-signal.h @@ -16,6 +16,11 @@ static inline uintptr_t host_signal_pc(ucontext_t *uc) return uc->uc_mcontext.arm_pc; } +static inline void host_signal_set_pc(ucontext_t *uc, uintptr_t pc) +{ + uc->uc_mcontext.arm_pc = pc; +} + static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc) { /* -- cgit v1.2.3-55-g7522