summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-10-07 19:07:22 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-10-12 17:00:08 +0200
commit924387597104bd5f2760eab0b783a243d7272cb6 (patch)
tree33683e2c8513e1abab9875dea557954be40a3c53 /arch/arm/cpu
parent01525288b031e868f5b39b55f3ff4b10d67399c3 (diff)
downloadbarebox-924387597104bd5f2760eab0b783a243d7272cb6.tar.gz
barebox-924387597104bd5f2760eab0b783a243d7272cb6.tar.xz
ARM exceptions: Do not use hardcoded STACK_BASE
The exception handlers need some space to write to. Traditionally this has been some stack space. This is not necessary at all, so just use some variable and get rid of the compile time fixed stack address. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r--arch/arm/cpu/exceptions.S15
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/arm/cpu/exceptions.S b/arch/arm/cpu/exceptions.S
index 7f94f9f929..fe63a373b0 100644
--- a/arch/arm/cpu/exceptions.S
+++ b/arch/arm/cpu/exceptions.S
@@ -37,9 +37,6 @@
#define MODE_SVC 0x13
#define I_BIT 0x80
-_STACK_START:
- .word STACK_BASE + STACK_SIZE - 4
-
/*
* use bad_save_user_regs for abort/prefetch/undef/swi ...
* use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling
@@ -48,8 +45,7 @@ _STACK_START:
.macro bad_save_user_regs
sub sp, sp, #S_FRAME_SIZE
stmia sp, {r0 - r12} @ Calling r0-r12
- ldr r2, _STACK_START
- sub r2, r2, #(8) @ set base 2 words into abort stack
+ ldr r2, =abort_stack
ldmia r2, {r2 - r3} @ get pc, cpsr
add r0, sp, #S_FRAME_SIZE @ restore sp_SVC
@@ -80,9 +76,7 @@ _STACK_START:
.endm
.macro get_bad_stack
- ldr r13, _STACK_START
- sub r13, r13, #(8) @ reserved a couple spots in abort stack
-
+ ldr r13, =abort_stack
str lr, [r13] @ save caller lr / spsr
mrs lr, spsr
str lr, [r13, #4]
@@ -163,3 +157,8 @@ fiq:
1: b 1b /* irq (interrupt) */
1: b 1b /* fiq (fast interrupt) */
#endif
+
+.section .data
+.align 4
+abort_stack:
+.space 8