diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-11-24 23:22:11 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-11-24 23:22:11 +0000 |
commit | 2ad207d4a0522fa0ea64abe93c4334f87444e45e (patch) | |
tree | e33b6e277363f64c464868d64e9828f5ed6488d0 /target-arm | |
parent | eea589cc221853688084a139c04fce50fc65745e (diff) | |
download | qemu-2ad207d4a0522fa0ea64abe93c4334f87444e45e.zip |
Thumb semihosting fixes.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3729 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-arm')
-rw-r--r-- | target-arm/helper.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/target-arm/helper.c b/target-arm/helper.c index 038025dac0..40bdeb186e 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -602,6 +602,15 @@ void do_interrupt_v7m(CPUARMState *env) armv7m_nvic_set_pending(env->v7m.nvic, ARMV7M_EXCP_MEM); return; case EXCP_BKPT: + if (semihosting_enabled) { + int nr; + nr = lduw_code(env->regs[15]) & 0xff; + if (nr == 0xab) { + env->regs[15] += 2; + env->regs[0] = do_arm_semihosting(env); + return; + } + } armv7m_nvic_set_pending(env->v7m.nvic, ARMV7M_EXCP_DEBUG); return; case EXCP_IRQ: @@ -687,7 +696,7 @@ void do_interrupt(CPUARMState *env) break; case EXCP_BKPT: /* See if this is a semihosting syscall. */ - if (env->thumb) { + if (env->thumb && semihosting_enabled) { mask = lduw_code(env->regs[15]) & 0xff; if (mask == 0xab && (env->uncached_cpsr & CPSR_M) != ARM_CPU_MODE_USR) { |