[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 9/9] target/m68k: Support semihosting on non-ColdFire targets
From: |
Richard Henderson |
Subject: |
[PULL 9/9] target/m68k: Support semihosting on non-ColdFire targets |
Date: |
Wed, 24 Apr 2024 15:51:23 -0700 |
From: Keith Packard <keithp@keithp.com>
According to the m68k semihosting spec:
"The instruction used to trigger a semihosting request depends on the
m68k processor variant. On ColdFire, "halt" is used; on other processors
(which don't implement "halt"), "bkpt #0" may be used."
Add support for non-CodeFire processors by matching BKPT #0 instructions.
Signed-off-by: Keith Packard <keithp@keithp.com>
[rth: Use semihosting_test()]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/m68k/translate.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index 647bd9d9be..169927552a 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -2646,6 +2646,11 @@ DISAS_INSN(bkpt)
#if defined(CONFIG_USER_ONLY)
gen_exception(s, s->base.pc_next, EXCP_DEBUG);
#else
+ /* BKPT #0 is the alternate semihosting instruction. */
+ if ((insn & 7) == 0 && semihosting_test(s)) {
+ gen_exception(s, s->pc, EXCP_SEMIHOSTING);
+ return;
+ }
gen_exception(s, s->base.pc_next, EXCP_ILLEGAL);
#endif
}
--
2.34.1
- [PULL 0/9] tcg + linux-user patch queue, Richard Henderson, 2024/04/24
- [PULL 1/9] meson: Make DEBUG_REMAP a meson option, Richard Henderson, 2024/04/24
- [PULL 2/9] linux-user: do_setsockopt: fix SOL_ALG.ALG_SET_KEY, Richard Henderson, 2024/04/24
- [PULL 3/9] linux-user: do_setsockopt: make ip_mreq local to the place it is used and inline target_to_host_ip_mreq(), Richard Henderson, 2024/04/24
- [PULL 4/9] linux-user: do_setsockopt: make ip_mreq_source local to the place where it is used, Richard Henderson, 2024/04/24
- [PULL 5/9] linux-user: do_setsockopt: eliminate goto in switch for SO_SNDTIMEO, Richard Henderson, 2024/04/24
- [PULL 6/9] linux-user: Add FITRIM ioctl, Richard Henderson, 2024/04/24
- [PULL 7/9] target/m68k: Pass semihosting arg to exit, Richard Henderson, 2024/04/24
- [PULL 9/9] target/m68k: Support semihosting on non-ColdFire targets,
Richard Henderson <=
- [PULL 8/9] target/m68k: Perform the semihosting test during translate, Richard Henderson, 2024/04/24
- Re: [PULL 0/9] tcg + linux-user patch queue, Richard Henderson, 2024/04/24