diff mbox series

[39/43] target/m68k: Remove EXCP_HALT_INSN

Message ID 20220430132932.324018-40-richard.henderson@linaro.org
State New
Headers show
Series semihosting cleanup | expand

Commit Message

Richard Henderson April 30, 2022, 1:29 p.m. UTC
Now that semihosting is not attached to EXCP_HALT_INSN,
we can use EXCP_HLT.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/m68k/cpu.h       | 1 -
 target/m68k/op_helper.c | 5 -----
 target/m68k/translate.c | 3 ++-
 3 files changed, 2 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h
index 60f88e6bc9..f10554318b 100644
--- a/target/m68k/cpu.h
+++ b/target/m68k/cpu.h
@@ -66,7 +66,6 @@ 
 #define EXCP_MMU_ACCESS     58  /* MMU Access Level Violation Error */
 
 #define EXCP_RTE            0x100
-#define EXCP_HALT_INSN      0x101
 
 #define M68K_DTTR0   0
 #define M68K_DTTR1   1
diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c
index a345245612..6218ac791b 100644
--- a/target/m68k/op_helper.c
+++ b/target/m68k/op_helper.c
@@ -201,11 +201,6 @@  static void cf_interrupt_all(CPUM68KState *env, int is_hw)
             /* Return from an exception.  */
             cf_rte(env);
             return;
-        case EXCP_HALT_INSN:
-            cs->halted = 1;
-            cs->exception_index = EXCP_HLT;
-            cpu_loop_exit(cs);
-            return;
         }
         if (cs->exception_index >= EXCP_TRAP0
             && cs->exception_index <= EXCP_TRAP15) {
diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index 51c546f26f..354a127e1a 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -4736,7 +4736,8 @@  DISAS_INSN(halt)
     if (maybe_semihosting(s)) {
         return;
     }
-    gen_exception(s, s->pc, EXCP_HALT_INSN);
+    tcg_gen_movi_i32(cpu_halted, 1);
+    gen_exception(s, s->pc, EXCP_HLT);
 }
 
 DISAS_INSN(stop)