On 9/18/21 20:44, Richard Henderson wrote:
> Split host_signal_pc and host_signal_write out of user-exec.c.
>
> Signed-off-by: Richard Henderson <[email protected]>
> ---
> linux-user/host/alpha/host-signal.h | 41 +++++++++++++++++++++++++++++
> accel/tcg/user-exec.c | 31 +---------------------
> 2 files changed, 42 insertions(+), 30 deletions(-)
> create mode 100644 linux-user/host/alpha/host-signal.h
> +#ifndef ALPHA_HOST_SIGNAL_H
> +#define ALPHA_HOST_SIGNAL_H
> +
> +static inline uintptr_t host_signal_pc(ucontext_t *uc)
> +{
> + return uc->uc_mcontext.sc_pc;
> +}
> +
> +static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc)
> +{
> + uint32_t *pc = uc->uc_mcontext.sc_pc;
BTW I'd use host_signal_pc() here for consistency with other targets.
> + uint32_t insn = *pc;
> +
> + /* XXX: need kernel patch to get write flag faster */
> + switch (insn >> 26) {
> + case 0x0d: /* stw */
> + case 0x0e: /* stb */
> + case 0x0f: /* stq_u */
> + case 0x24: /* stf */
> + case 0x25: /* stg */
[...]