aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/SAM7S256/Include/Cstartup.S
diff options
context:
space:
mode:
Diffstat (limited to 'AT91SAM7S256/SAM7S256/Include/Cstartup.S')
-rw-r--r--AT91SAM7S256/SAM7S256/Include/Cstartup.S38
1 files changed, 31 insertions, 7 deletions
diff --git a/AT91SAM7S256/SAM7S256/Include/Cstartup.S b/AT91SAM7S256/SAM7S256/Include/Cstartup.S
index d02cf3f..0293251 100644
--- a/AT91SAM7S256/SAM7S256/Include/Cstartup.S
+++ b/AT91SAM7S256/SAM7S256/Include/Cstartup.S
@@ -136,20 +136,31 @@ FIQ_Handler_Entry:
/* end of fiqhandler */
Reset_Addr: .word InitReset
+#ifdef ARMDEBUG
Undef_Addr: .word undef_handler /* BKPT instruction trap */
+#else
+Undef_Addr: .word Undef_Handler
+#endif
SWI_Addr: .word SWI_Handler
/*SWI_Addr: .word SoftwareInterruptASM*/ /*in swi_handler.S */
+#ifdef ARMDEBUG
PAbt_Addr: .word prefetch_abort_handler
DAbt_Addr: .word data_abort_handler
+#else
+PAbt_Addr: .word PAbt_Handler
+DAbt_Addr: .word DAbt_Handler
+#endif
IRQ_Addr: .word IRQ_Handler_Entry
- .global default_undef_handler
+ .global default_undef_handler
default_undef_handler:
Undef_Handler: B Undef_Handler
SWI_Handler: B SWI_Handler
- .global default_prefetch_abort_handler
+ .global default_prefetch_abort_handler
+default_prefetch_abort_handler:
PAbt_Handler: B PAbt_Handler
- .global default_data_abort_handler
+ .global default_data_abort_handler
+default_data_abort_handler:
DAbt_Handler: B DAbt_Handler
@@ -259,7 +270,7 @@ already_remapped:
.EQU ARM_MODE_FIQ, 0x11
.EQU ARM_MODE_IRQ, 0x12
.EQU ARM_MODE_SVC, 0x13
- .EQU ARM_MODE_ABT, 0x17
+ .EQU ARM_MODE_ABT, 0x17
.EQU I_BIT, 0x80
.EQU F_BIT, 0x40
@@ -269,9 +280,11 @@ already_remapped:
//*-------------------------------*/
mov r0, sp /* see (**) */
+#ifdef ARMDEBUG
/*- Set up Abort Mode Stack for Debugger*/
msr CPSR_c, #ARM_MODE_ABT | I_BIT | F_BIT
- ldr sp, =__abort_stack_top__
+ ldr sp, =__abort_stack_top__
+#endif
/*- Set up Fast Interrupt Mode and set FIQ Mode Stack*/
msr CPSR_c, #ARM_MODE_FIQ | I_BIT | F_BIT
@@ -295,8 +308,6 @@ already_remapped:
mov sp, r0 /* Init stack Sup */
-
-
/*- Enable interrupt & Set up Supervisor Mode and set Supervisor Mode Stack*/
/* Relocate .data section (Copy from ROM to RAM)
@@ -449,5 +460,18 @@ AT91F_Spurious_handler:
.size AT91F_Spurious_handler, . - AT91F_Spurious_handler
.endfunc
+/*------------------------------------------------------------------------------
+//*- Various debugger stacks.
+//*-------------------------------*/
+
+#ifdef ARMDEBUG
+.section .stack.abort, "aw", %nobits
+ .space 0x80; /* 128 byte abort mode stack. */
+.section .stack.debugger, "aw", %nobits
+ .space 0x48; /* 16 user mode registers + SPSR + UNDEF Next Instruction Address */
+.section .breakpoints, "aw", %nobits
+ .space 0x40; /* Single Stepping Breakpoint + 7 Breakpoints */
+#endif
+
.end