Re: [PATCH v2 5/7] target/mips: use semihosting_exit_request on semihosted exit syscall
Le 21/06/2022 à 14:59, Luc Michel a écrit : Use the new semihosting_exit_request instead of a call to exit when handling a semihosted exit syscall. Signed-off-by: Luc Michel --- target/mips/tcg/sysemu/mips-semi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/mips/tcg/sysemu/mips-semi.c b/target/mips/tcg/sysemu/mips-semi.c index b4a383ae90..94be486925 100644 --- a/target/mips/tcg/sysemu/mips-semi.c +++ b/target/mips/tcg/sysemu/mips-semi.c @@ -245,11 +245,11 @@ void helper_do_semihosting(CPUMIPSState *env) char *p, *p2; switch (op) { case UHI_exit: qemu_log("UHI(%d): exit(%d)\n", op, (int)gpr[4]); -exit(gpr[4]); +semihosting_exit_request(gpr[4]); case UHI_open: GET_TARGET_STRING(p, gpr[4]); if (!strcmp("/dev/stdin", p)) { gpr[2] = 0; } else if (!strcmp("/dev/stdout", p)) { Reviewed-by: Laurent Vivier
[PATCH v2 5/7] target/mips: use semihosting_exit_request on semihosted exit syscall
Use the new semihosting_exit_request instead of a call to exit when handling a semihosted exit syscall. Signed-off-by: Luc Michel --- target/mips/tcg/sysemu/mips-semi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/mips/tcg/sysemu/mips-semi.c b/target/mips/tcg/sysemu/mips-semi.c index b4a383ae90..94be486925 100644 --- a/target/mips/tcg/sysemu/mips-semi.c +++ b/target/mips/tcg/sysemu/mips-semi.c @@ -245,11 +245,11 @@ void helper_do_semihosting(CPUMIPSState *env) char *p, *p2; switch (op) { case UHI_exit: qemu_log("UHI(%d): exit(%d)\n", op, (int)gpr[4]); -exit(gpr[4]); +semihosting_exit_request(gpr[4]); case UHI_open: GET_TARGET_STRING(p, gpr[4]); if (!strcmp("/dev/stdin", p)) { gpr[2] = 0; } else if (!strcmp("/dev/stdout", p)) { -- 2.17.1