diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-02-04 19:35:26 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-02-04 19:35:26 +0000 |
commit | 06c949e62a098f97bd68a7382eb1953898a11e09 (patch) | |
tree | 6b61094e2ea53aa0f9f02a0e74cdc0e84a523739 /linux-user | |
parent | 0240ded8bb1580147ed2ff1748df439a3b41e38f (diff) |
Implement Arm BKPT instruction.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1740 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/main.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/linux-user/main.c b/linux-user/main.c index ef3a171166..56accfbb52 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -358,14 +358,27 @@ void cpu_loop(CPUARMState *env) } break; case EXCP_SWI: + case EXCP_BKPT: { /* system call */ - if (env->thumb) { - insn = lduw((void *)(env->regs[15] - 2)); - n = insn & 0xff; + if (trapnr == EXCP_BKPT) { + if (env->thumb) { + insn = lduw((void *)(env->regs[15])); + n = insn & 0xff; + env->regs[15] += 2; + } else { + insn = ldl((void *)(env->regs[15])); + n = (insn & 0xf) | ((insn >> 4) & 0xff0); + env->regs[15] += 4; + } } else { - insn = ldl((void *)(env->regs[15] - 4)); - n = insn & 0xffffff; + if (env->thumb) { + insn = lduw((void *)(env->regs[15] - 2)); + n = insn & 0xff; + } else { + insn = ldl((void *)(env->regs[15] - 4)); + n = insn & 0xffffff; + } } if (n == ARM_NR_cacheflush) { |