diff options
author | Keith Packard <keithp@keithp.com> | 2023-08-01 08:22:45 -0700 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2023-08-01 23:52:23 +0200 |
commit | c11d5bdae79a8edaf00dfcb2e49c064a50c67671 (patch) | |
tree | bb9912fa2a57a739de1ebe84136a8997016141c4 /target | |
parent | 7a06a8fec9df3b6a0f72e7b37dff0969430aab96 (diff) | |
download | qemu-c11d5bdae79a8edaf00dfcb2e49c064a50c67671.zip qemu-c11d5bdae79a8edaf00dfcb2e49c064a50c67671.tar.gz qemu-c11d5bdae79a8edaf00dfcb2e49c064a50c67671.tar.bz2 |
target/nios2: Pass semihosting arg to exit
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>
Diffstat (limited to 'target')
-rw-r--r-- | target/nios2/nios2-semi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/target/nios2/nios2-semi.c b/target/nios2/nios2-semi.c index 3738774..f3b7aee 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); |