diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-05-26 15:09:38 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-05-26 15:09:38 +0000 |
commit | a87295e8df0923dab9857c1a340d23fe3278a336 (patch) | |
tree | 30c629030791710b509b88fceb184766f97743cd /target-m68k/op_helper.c | |
parent | 20c9f095c4536e64e60432a5c72fce38e8306cbb (diff) |
M68k system mode semihosting.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2861 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-m68k/op_helper.c')
-rw-r--r-- | target-m68k/op_helper.c | 16 |
1 files changed, 16 insertions, 0 deletions
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) { |