path: root/Debugger/undef_handler.S
diff options
authorTC Wan2010-12-17 09:58:02 +0800
committerTC Wan2010-12-17 09:58:02 +0800
commite3a7c6a9da89b96f2b7026e71d8e3beb1f5bd140 (patch)
treecbc0edd739deb17a6f2e95fd918af4a6aa8e706a /Debugger/undef_handler.S
parentc75b604e97fc736221cfffe63033cb2ac8239ac0 (diff)
store user mode next instruction address in r15 slot
Keep Next Instruction Address in User Mode R15 stack frame slot.
Diffstat (limited to 'Debugger/undef_handler.S')
1 files changed, 2 insertions, 1 deletions
diff --git a/Debugger/undef_handler.S b/Debugger/undef_handler.S
index 61b8a5d..34154f7 100644
--- a/Debugger/undef_handler.S
+++ b/Debugger/undef_handler.S
@@ -35,7 +35,8 @@ undef_handler:
On entry, LR_undef points to one instruction past the UNDEF instruction
ldr sp, =__debugger_stack__
- stmfd sp, {r0-r15}^ /* Save workspace, user mode's pc via 'S' flag */
+ stmfd sp, {r0-r15}^ /* Save workspace, user mode's pc via 'S' flag, R15: placeholder */
+ str lr, [sp, #-4] /* Keep User's Next Instr Pointer (in UNDEF SP) in user mode R15 */
sub sp, sp, #(4*16) /* Need to manually update SP(undef) */
mrs r1, spsr /* Copy SPSR to r0 */
tst r1, #CPSR_THUMB /* Check for Thumb Mode */