From: Richard Henderson <richard.henderson@linaro.org>
To: Nick Hudson <skrll@netbsd.org>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Kamil Rytarowski <kamil@netbsd.org>,
Riku Voipio <riku.voipio@iki.fi>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH 1/1] NetBSD/arm build fix
Date: Wed, 13 May 2020 09:25:00 -0700 [thread overview]
Message-ID: <a6b6cedd-7e6b-642e-e441-63f68f005582@linaro.org> (raw)
In-Reply-To: <20200512064823.13025-1-skrll@netbsd.org>
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~
prev parent reply other threads:[~2020-05-13 16:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-12 6:48 [PATCH 1/1] NetBSD/arm build fix Nick Hudson
2020-05-13 16:25 ` Richard Henderson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a6b6cedd-7e6b-642e-e441-63f68f005582@linaro.org \
--to=richard.henderson@linaro.org \
--cc=kamil@netbsd.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
--cc=rth@twiddle.net \
--cc=skrll@netbsd.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).