aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-07-09 08:04:31 +0800
committerTat-Chee Wan (USM)2011-07-09 08:04:31 +0800
commita250b0f75e58053ee3e7428b8499baa9ddec3e88 (patch)
tree9d736c1473a2b081c5746a68fe5cb640d4029bfd
parent7d70ae2da93e8fe92e0eb471ed4278a59cab0cf8 (diff)
cleanup abort handler to armdebug interface
-rw-r--r--Debugger/abort_handler.S13
-rw-r--r--Debugger/debug_internals.h8
-rw-r--r--Debugger/debug_stub.S11
3 files changed, 23 insertions, 9 deletions
diff --git a/Debugger/abort_handler.S b/Debugger/abort_handler.S
index a968374..7d2e158 100644
--- a/Debugger/abort_handler.S
+++ b/Debugger/abort_handler.S
@@ -51,7 +51,7 @@
.align 0
.extern dbg__display_abort_info
- .extern dbg__bkpt_waitCMD
+ .extern dbg__abort_exception_handler
.extern default_prefetch_abort_handler
.extern default_data_abort_handler
@@ -62,14 +62,16 @@ prefetch_abort_handler:
ldr sp, =__debugger_stack__
stmfd sp, {r0-r15}^ /* Save workspace, previous mode's pc via 'S' flag, R13-R15: placeholders */
mov r2, #PREFETCH_OFFSET
- mov r4, #ABORT_PREFETCH
+ mov r4, #DISP_ABORT_PREFETCH /* Display Abort Info Type */
+ mov r5, #DBG_ABORT_PREFETCH /* Debugger Abort Type */
b _common_abort_handler
data_abort_handler:
ldr sp, =__debugger_stack__
stmfd sp, {r0-r15}^ /* Save workspace, previous mode's pc via 'S' flag, R13-R15: placeholders */
mov r2, #DATA_OFFSET
- mov r4, #ABORT_DATA
+ mov r4, #DISP_ABORT_DATA /* Display Abort Info Type */
+ mov r5, #DBG_ABORT_DATA /* Debugger Abort Type */
_common_abort_handler:
sub r0, lr, r2 /* R0: Adjust PC to ABORTed instruction address */
@@ -99,8 +101,9 @@ _store_prev_mode_banked_regs:
_exit_abort_handler:
ldr sp, =__abort_stack__ /* Reinitialize stack pointer each time an Abort happens */
bic sp, sp, #7
- mov r0, r4 /* Copy Abort Type Enum to R0 */
+ mov r0, r4 /* Copy Display Abort Type Enum to R0 */
bl dbg__display_abort_info /* Display Abort Type to LCD */
- b dbg__bkpt_waitCMD /* Invoke Debugger */
+ mov r0, r5 /* Copy Debugger Abort Type Enum to R0 */
+ b dbg__abort_exception_handler /* Invoke Debugger */
diff --git a/Debugger/debug_internals.h b/Debugger/debug_internals.h
index 91a55cb..56cf26a 100644
--- a/Debugger/debug_internals.h
+++ b/Debugger/debug_internals.h
@@ -346,10 +346,10 @@ ENUM_END(register_enum_t)
* Note: The values must align with those defined in NxOS's _abort.h
*/
ENUM_BEGIN
-ENUM_VALASSIGN(ABORT_PREFETCH,0) /**< Prefetch Abort. */
-ENUM_VAL(ABORT_DATA) /**< Data Abort. */
-ENUM_VAL(ABORT_SPURIOUS) /**< Spurious IRQ. */
-ENUM_VAL(ABORT_ILLEGAL) /**< Illegal Instruction. */
+ENUM_VALASSIGN(DISP_ABORT_PREFETCH,0) /**< Prefetch Abort. */
+ENUM_VAL(DISP_ABORT_DATA) /**< Data Abort. */
+ENUM_VAL(DISP_ABORT_SPURIOUS) /**< Spurious IRQ. */
+ENUM_VAL(DISP_ABORT_ILLEGAL) /**< Illegal Instruction. */
ENUM_END(abort_type_t)
#endif /* __DEBUG_INTERNALS_H__ */
diff --git a/Debugger/debug_stub.S b/Debugger/debug_stub.S
index ccd411d..193705e 100644
--- a/Debugger/debug_stub.S
+++ b/Debugger/debug_stub.S
@@ -390,6 +390,17 @@ _dbg__flush_icache:
/* nop */
bx lr
+/* dbg__abort_exception_handler
+ * Handle Abort Exceptions
+ * On entry:
+ * r0: Abort Type Enum
+ * On exit:
+ * routine does not 'exit' in the normal sense
+ */
+ .global dbg__abort_exception_handler
+dbg__abort_exception_handler:
+ _dbg_set_bkpt_type r0 /* Set Breakpoint Type given value in R0 */
+ b dbg__bkpt_waitCMD
/* dbg__thumb_bkpt_handler
* GDB handle_exception() routine (Thumb Mode)