Message ID | 20231003223624.1753000-3-richard.henderson@linaro.org |
---|---|
State | New |
Headers | show |
Series | target/m68k: Support semihosting on non-ColdFire targets | expand |
diff --git a/target/m68k/translate.c b/target/m68k/translate.c index e07b0b659d..54c3ff1218 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -2663,6 +2663,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 }