summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2023-08-02 09:19:12 -0700
committerRichard Henderson <richard.henderson@linaro.org>2024-04-24 15:46:00 -0700
commit5fae5110eedba1110605c88d96cd4a5f057bfca2 (patch)
tree46ae4d6e2da6c4378d6975322892f61589dace48
parent7048fc59ef6a9f76693db3bafede6234a3897385 (diff)
downloadfocaccia-qemu-5fae5110eedba1110605c88d96cd4a5f057bfca2.tar.gz
focaccia-qemu-5fae5110eedba1110605c88d96cd4a5f057bfca2.zip
target/m68k: Pass semihosting arg to exit
Instead of using d0 (the semihost function number), use d1 (the
provide exit status).

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20230802161914.395443-2-keithp@keithp.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--target/m68k/m68k-semi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target/m68k/m68k-semi.c b/target/m68k/m68k-semi.c
index 546cff2246..6fbbd140f3 100644
--- a/target/m68k/m68k-semi.c
+++ b/target/m68k/m68k-semi.c
@@ -132,8 +132,8 @@ void do_m68k_semihosting(CPUM68KState *env, int nr)
     args = env->dregs[1];
     switch (nr) {
     case HOSTED_EXIT:
-        gdb_exit(env->dregs[0]);
-        exit(env->dregs[0]);
+        gdb_exit(env->dregs[1]);
+        exit(env->dregs[1]);
 
     case HOSTED_OPEN:
         GET_ARG(0);