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 <hschau...@nulltrace.org>
---
 arch/arm/cpu/arm926ejs/start.S |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

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
-- 
1.7.0.4


----- End forwarded message -----
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to