Use the new semihosting_exit_request instead of a call to exit when
handling a semihosted exit syscall.
Signed-off-by: Luc Michel <lmichel@kalray.eu>
---
target/m68k/m68k-semi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/m68k/m68k-semi.c b/target/m68k/m68k-semi.c
index 37343d47e2..b3de3c6874 100644
--- a/target/m68k/m68k-semi.c
+++ b/target/m68k/m68k-semi.c
@@ -27,10 +27,11 @@
#else
#include "exec/softmmu-semi.h"
#include "hw/boards.h"
#endif
#include "qemu/log.h"
+#include "semihosting/semihost.h"
#define HOSTED_EXIT 0
#define HOSTED_INIT_SIM 1
#define HOSTED_OPEN 2
#define HOSTED_CLOSE 3
@@ -193,12 +194,11 @@ void do_m68k_semihosting(CPUM68KState *env, int nr)
uint32_t result;
args = env->dregs[1];
switch (nr) {
case HOSTED_EXIT:
- gdb_exit(env->dregs[0]);
- exit(env->dregs[0]);
+ semihosting_exit_request(env->dregs[0]);
case HOSTED_OPEN:
GET_ARG(0);
GET_ARG(1);
GET_ARG(2);
GET_ARG(3);
--
2.17.1