qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Keith Packard via <qemu-devel@nongnu.org>
To: qemu-devel@nongnu.org
Cc: Chris Wulff <crwulff@gmail.com>, Marek Vasut <marex@denx.de>,
	Keith Packard <keithp@keithp.com>
Subject: [PATCH] target/nios2: Pass semihosting arg to exit
Date: Tue,  1 Aug 2023 08:22:45 -0700	[thread overview]
Message-ID: <20230801152245.332749-1-keithp@keithp.com> (raw)

Instead of using R_ARG0 (the semihost function number), use R_ARG1
(the provided exit status).

Signed-off-by: Keith Packard <keithp@keithp.com>
---
 target/nios2/nios2-semi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/nios2/nios2-semi.c b/target/nios2/nios2-semi.c
index 3738774976..f3b7aee4f1 100644
--- a/target/nios2/nios2-semi.c
+++ b/target/nios2/nios2-semi.c
@@ -133,8 +133,8 @@ void do_nios2_semihosting(CPUNios2State *env)
     args = env->regs[R_ARG1];
     switch (nr) {
     case HOSTED_EXIT:
-        gdb_exit(env->regs[R_ARG0]);
-        exit(env->regs[R_ARG0]);
+        gdb_exit(env->regs[R_ARG1]);
+        exit(env->regs[R_ARG1]);
 
     case HOSTED_OPEN:
         GET_ARG(0);
-- 
2.40.1



             reply	other threads:[~2023-08-01 15:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01 15:22 Keith Packard via [this message]
2023-08-01 15:24 ` [PATCH] target/nios2: Pass semihosting arg to exit Peter Maydell
2023-08-01 21:45 ` Philippe Mathieu-Daudé
  -- strict thread matches above, loose matches on Subject: below --
2023-07-31 22:41 Keith Packard via
2023-08-01 12:04 ` Peter Maydell
2023-08-01 15:10   ` Keith Packard via
2023-08-01 15:17     ` Peter Maydell
2023-08-01 15:28       ` Keith Packard via
2023-08-01 15:33         ` 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=20230801152245.332749-1-keithp@keithp.com \
    --to=qemu-devel@nongnu.org \
    --cc=crwulff@gmail.com \
    --cc=keithp@keithp.com \
    --cc=marex@denx.de \
    /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).