Fix in interrupt handling part of arm926ejs.
PATCH 1/1 Fix in interrupt handling part of arm926ejs.
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 <[email protected]>
--- arch/arm/cpu/arm926ejs/start.S | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
arch/arm/cpu/arm926ejs/start.S +2 -3
@@ -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
Signature · 1 line
1.7.0.4