[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.0.4 49/63] target/nios2: Pass semihosting arg to exit
From: |
Michael Tokarev |
Subject: |
[Stable-8.0.4 49/63] target/nios2: Pass semihosting arg to exit |
Date: |
Fri, 4 Aug 2023 22:16:32 +0300 |
From: Keith Packard <keithp@keithp.com>
Instead of using R_ARG0 (the semihost function number), use R_ARG1
(the provided exit status).
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20230801152245.332749-1-keithp@keithp.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
(cherry picked from commit c11d5bdae79a8edaf00dfcb2e49c064a50c67671)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
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.39.2
[Prev in Thread] |
Current Thread |
[Next in Thread] |