Patchwork [U-Boot,1/1] Fix in interrupt handling part of arm926ejs.

login
register
mail settings
Submitter Himanshu Chauhan
Date Oct. 29, 2010, 7:40 p.m.
Message ID <1288381231-12362-1-git-send-email-hschauhan@nulltrace.org>
Download mbox | patch
Permalink /patch/71961/
State Rejected
Delegated to: Albert ARIBAUD
Headers show

Comments

Himanshu Chauhan - Oct. 29, 2010, 7:40 p.m.
Macro get_bad_stack used to load SVC mode stack pointer
in r13 and then re-use the register, without saving,
for further modifying the spsr, thus trashing the r13.
r13 is never loaded again after this.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
---
 arch/arm/cpu/arm926ejs/start.S |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

Patch

diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index 7397882..47d7aac 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -523,9 +523,8 @@  cpu_init_crit:
 	str	lr, [r13]	@ save caller lr in position 0 of saved stack
 	mrs	lr, spsr	@ get the spsr
 	str	lr, [r13, #4]	@ save spsr in position 1 of saved stack
-	mov	r13, #MODE_SVC	@ prepare SVC-Mode
-	@ msr	spsr_c, r13
-	msr	spsr, r13	@ switch modes, make sure moves will execute
+	mov	lr, #MODE_SVC	@ prepare SVC-Mode
+	msr	spsr, lr	@ switch modes, make sure moves will execute
 	mov	lr, pc		@ capture return pc
 	movs	pc, lr		@ jump to next instruction & switch modes.
 	.endm