From: Peter Maydell <peter.maydell@linaro.org>
To: Christopher Covington <christopher.covington@linaro.org>
Cc: Liviu Ionescu <ilg@livius.net>, QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 2/3] arm: semihosting: Create unsupported call function
Date: Fri, 27 Mar 2015 16:41:53 +0000 [thread overview]
Message-ID: <CAFEAcA8ke_VP8B2GLkVghYJigQdRGza5kQvZKJb86JNz-r3-cQ@mail.gmail.com> (raw)
In-Reply-To: <1427473355-17129-3-git-send-email-christopher.covington@linaro.org>
On 27 March 2015 at 16:22, Christopher Covington
<christopher.covington@linaro.org> wrote:
> This will allow the print-error-and-exit sequence to be called from a
> second location in a subsequent patch. The type of the nr variable is
> changed from int to uint32_t since I'm unaware of semihosting call
> numbers needing more than 32 bits, even on AArch64. Also generalize
> the wording of the unsupported semihosting call error message so that
> it will make sense on AArch64 as well.
>
> Signed-off-by: Christopher Covington <christopher.covington@linaro.org>
> ---
> target-arm/arm-semi.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/target-arm/arm-semi.c b/target-arm/arm-semi.c
> index a8b83e6..d915123 100644
> --- a/target-arm/arm-semi.c
> +++ b/target-arm/arm-semi.c
> @@ -174,6 +174,13 @@ static void arm_semi_flen_cb(CPUState *cs, target_ulong ret, target_ulong err)
> #endif
> }
>
> +static void QEMU_NORETURN unsupported_semihosting(uint32_t nr, CPUState *cs)
> +{
> + fprintf(stderr, "qemu: Unsupported semihosting call 0x%02x\n", nr);
> + cpu_dump_state(cs, stderr, fprintf, 0);
> + abort();
> +}
> +
> /* Read the input value from the argument block; fail the semihosting
> * call if the memory read fails.
> */
> @@ -191,7 +198,7 @@ uint32_t do_arm_semihosting(CPUARMState *env)
> target_ulong args;
> target_ulong arg0, arg1, arg2, arg3;
> char * s;
> - int nr;
> + uint32_t nr;
> uint32_t ret;
> uint32_t len;
> #ifdef CONFIG_USER_ONLY
> @@ -561,8 +568,6 @@ uint32_t do_arm_semihosting(CPUARMState *env)
> gdb_exit(env, ret);
> exit(ret);
> default:
> - fprintf(stderr, "qemu: Unsupported SemiHosting SWI 0x%02x\n", nr);
> - cpu_dump_state(cs, stderr, fprintf, 0);
> - abort();
> + unsupported_semihosting(nr, cs);
> }
> }
> --
> 1.9.1
OK, I guess, though I think the need to call from multiple places
goes away as soon as we've implemented all the calls, so I would
personally just have implemented them all...
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
next prev parent reply other threads:[~2015-03-27 16:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-27 16:22 [Qemu-devel] arm: semihosting: Preliminary AArch64 support Christopher Covington
2015-03-27 16:22 ` [Qemu-devel] [PATCH 1/3] arm: semihosting: Improve debug prints Christopher Covington
2015-03-27 16:25 ` Peter Maydell
2015-03-27 16:22 ` [Qemu-devel] [PATCH 2/3] arm: semihosting: Create unsupported call function Christopher Covington
2015-03-27 16:41 ` Peter Maydell [this message]
2015-03-27 16:22 ` [Qemu-devel] [PATCH 3/3] arm: semihosting: Wire up A64 HLT 0xf000 Christopher Covington
2015-03-27 16:40 ` Peter Maydell
2015-03-28 12:27 ` Christopher Covington
2015-03-31 11:22 ` Peter Maydell
2015-03-27 16:57 ` [Qemu-devel] arm: semihosting: Preliminary AArch64 support Liviu Ionescu
2015-03-27 17:05 ` Peter Maydell
2015-03-27 17:15 ` Leon Alrae
2015-03-27 17:21 ` Peter Maydell
2015-03-27 17:33 ` Liviu Ionescu
2015-03-30 11:44 ` Leon Alrae
2015-03-30 12:27 ` Liviu Ionescu
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=CAFEAcA8ke_VP8B2GLkVghYJigQdRGza5kQvZKJb86JNz-r3-cQ@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=christopher.covington@linaro.org \
--cc=ilg@livius.net \
--cc=qemu-devel@nongnu.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).