From: Peter Maydell <peter.maydell@linaro.org>
To: Christophe Lyon <christophe.lyon@st.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] target-arm: return the right exit code when using semi-hosting.
Date: Fri, 18 Feb 2011 16:13:27 +0000 [thread overview]
Message-ID: <AANLkTinHoWKayV1cK=BERSti4s3JeWK0vJ2O9PwKsGFr@mail.gmail.com> (raw)
In-Reply-To: <1298043923-13787-1-git-send-email-christophe.lyon@st.com>
On 18 February 2011 15:45, Christophe Lyon <christophe.lyon@st.com> wrote:
> On ARM, the SYS_EXIT semi-hosting call has no room for application
> exit code, hence exiting a program from qemu always returns 0.
>
> This patch catches to argument passed to exit() and uses it as the
> return code when processing SYS_EXIT.
I'm afraid you've just run into the limitations of semihosting
as an API again: it doesn't provide a way for programs to pass
out an exit code, and trying to shoehorn back doors for this
into qemu just results in ugly code in qemu. The qemu
implementation of semihosting should implement the semihosting
API, not semihosting with weird undocumented extras.
If you care about this sort of thing then linux-user mode is
probably a better approach, as that is actually designed for
a unixish program to run as-if-natively.
-- PMM
next prev parent reply other threads:[~2011-02-18 16:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-18 15:45 [Qemu-devel] [PATCH] target-arm: return the right exit code when using semi-hosting Christophe Lyon
2011-02-18 16:13 ` Peter Maydell [this message]
2011-02-18 16:29 ` Christophe Lyon
2011-02-18 17:38 ` Peter Maydell
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='AANLkTinHoWKayV1cK=BERSti4s3JeWK0vJ2O9PwKsGFr@mail.gmail.com' \
--to=peter.maydell@linaro.org \
--cc=christophe.lyon@st.com \
--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).