From patchwork Fri Oct 29 19:40:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,1/1] Fix in interrupt handling part of arm926ejs. From: Himanshu Chauhan X-Patchwork-Id: 71961 Message-Id: <1288381231-12362-1-git-send-email-hschauhan@nulltrace.org> To: u-boot@lists.denx.de Date: Sat, 30 Oct 2010 01:10:31 +0530 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 --- 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