[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/35] target/m68k: Support semihosting on non-ColdFire targets
|
From: |
Richard Henderson |
|
Subject: |
[PULL 18/35] target/m68k: Support semihosting on non-ColdFire targets |
|
Date: |
Mon, 8 Apr 2024 07:49:12 -1000 |
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 8f61ff1238..659543020b 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 09/35] target/hppa: Fix IIAOQ, IIASQ for pa2.0, (continued)
- [PULL 09/35] target/hppa: Fix IIAOQ, IIASQ for pa2.0, Richard Henderson, 2024/04/08
- [PULL 10/35] target/sh4: mac.w: memory accesses are 16-bit words, Richard Henderson, 2024/04/08
- [PULL 11/35] target/sh4: Merge mach and macl into a union, Richard Henderson, 2024/04/08
- [PULL 05/35] linux-user: do_setsockopt: make ip_mreq_source local to the place where it is used, Richard Henderson, 2024/04/08
- [PULL 12/35] target/sh4: Fix mac.l with saturation enabled, Richard Henderson, 2024/04/08
- [PULL 14/35] target/sh4: add missing CHECK_NOT_DELAY_SLOT, Richard Henderson, 2024/04/08
- [PULL 13/35] target/sh4: Fix mac.w with saturation enabled, Richard Henderson, 2024/04/08
- [PULL 16/35] target/m68k: Pass semihosting arg to exit, Richard Henderson, 2024/04/08
- [PULL 15/35] target/m68k: Map FPU exceptions to FPSR register, Richard Henderson, 2024/04/08
- [PULL 17/35] target/m68k: Perform the semihosting test during translate, Richard Henderson, 2024/04/08
- [PULL 18/35] target/m68k: Support semihosting on non-ColdFire targets,
Richard Henderson <=
- [PULL 19/35] tcg: Add TCGContext.emit_before_op, Richard Henderson, 2024/04/08
- [PULL 20/35] accel/tcg: Add insn_start to DisasContextBase, Richard Henderson, 2024/04/08
- [PULL 21/35] target/arm: Use insn_start from DisasContextBase, Richard Henderson, 2024/04/08
- [PULL 23/35] target/i386: Preserve DisasContextBase.insn_start across rewind, Richard Henderson, 2024/04/08
- [PULL 24/35] target/microblaze: Use insn_start from DisasContextBase, Richard Henderson, 2024/04/08
- [PULL 25/35] target/riscv: Use insn_start from DisasContextBase, Richard Henderson, 2024/04/08
- [PULL 26/35] target/s390x: Use insn_start from DisasContextBase, Richard Henderson, 2024/04/08
- [PULL 27/35] accel/tcg: Improve can_do_io management, Richard Henderson, 2024/04/08
- [PULL 29/35] util/bufferiszero: Remove AVX512 variant, Richard Henderson, 2024/04/08
- [PULL 28/35] util/bufferiszero: Remove SSE4.1 variant, Richard Henderson, 2024/04/08