Re: [RFC v2 1/6] linux-user: Add host_signal_set_pc to set pc in mcontext

2021-11-10 Thread Warner Losh
On Wed, Nov 10, 2021 at 9:42 AM Richard Henderson < richard.hender...@linaro.org> wrote: > On 11/10/21 5:31 PM, Warner Losh wrote: > > +static inline void host_signal_set_pc(ucontext_t *uc, uintptr_t pc) > > +{ > > +#ifdef __arch64__ > > +uc->uc_mcontext.mc_gregs[MC_PC] = pc; > > +#else > > +

Re: [RFC v2 1/6] linux-user: Add host_signal_set_pc to set pc in mcontext

2021-11-10 Thread Richard Henderson
On 11/10/21 5:31 PM, Warner Losh wrote: +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; Stray & here. Not that I have a sparc32 host on which to compile this..

[RFC v2 1/6] linux-user: Add host_signal_set_pc to set pc in mcontext

2021-11-10 Thread Warner Losh
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. Signed-off-by: Warner Losh Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- linux-user/host/aarch64/host-signal.h | 5 + linux-user/host