qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/1] NetBSD/arm build fix


From: Richard Henderson
Subject: Re: [PATCH 1/1] NetBSD/arm build fix
Date: Wed, 13 May 2020 09:25:00 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 5/11/20 11:48 PM, Nick Hudson wrote:
>  
> +#if defined(__NetBSD__)
> +    /* siginfo_t::si_trap is the FSR value, in which bit 11 is WnR
> +     * (assuming a v6 or later processor; on v5 we will always report
> +     * this as a read).
> +     */
> +    is_write = extract32(si->si_trap, 11, 1);
> +#else
>      /* error_code is the FSR value, in which bit 11 is WnR (assuming a v6 or
>       * later processor; on v5 we will always report this as a read).
>       */
>      is_write = extract32(uc->uc_mcontext.error_code, 11, 1);
> +#endif

While this works, I think it might be a bit clearer as


    uint32_t fsr;

#ifdef __NetBSD__
    fsr = si->si_trap;
#else
    fsr = uc->uc_mcontext.error_code;
#endif
    /*
     * In the FSR, bit 11 is WnR, assuming a v6 or
     * later processor.  On v5 we will always report
     * this as a read, which will fail later.
     */
    is_write = extract32(fsr, 11, 1);


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]