From a87295e8df0923dab9857c1a340d23fe3278a336 Mon Sep 17 00:00:00 2001 From: pbrook Date: Sat, 26 May 2007 15:09:38 +0000 Subject: M68k system mode semihosting. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2861 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-m68k/op_helper.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'target-m68k/op_helper.c') diff --git a/target-m68k/op_helper.c b/target-m68k/op_helper.c index 7455e31659..f5593eca0c 100644 --- a/target-m68k/op_helper.c +++ b/target-m68k/op_helper.c @@ -28,6 +28,8 @@ void do_interrupt(int is_hw) #else +extern int semihosting_enabled; + #define MMUSUFFIX _mmu #define GETPC() (__builtin_return_address(0)) @@ -104,6 +106,20 @@ void do_interrupt(int is_hw) /* Return from an exception. */ do_rte(); return; + case EXCP_HALT_INSN: + if (semihosting_enabled + && (env->sr & SR_S) != 0 + && (env->pc & 3) == 0 + && lduw_code(env->pc - 4) == 0x4e71 + && ldl_code(env->pc) == 0x4e7bf000) { + env->pc += 4; + do_m68k_semihosting(env, env->dregs[0]); + return; + } + env->halted = 1; + env->exception_index = EXCP_HLT; + cpu_loop_exit(); + return; } if (env->exception_index >= EXCP_TRAP0 && env->exception_index <= EXCP_TRAP15) { -- cgit v1.2.3