You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aarch32-rt/src/arch_v4/interrupt.rs
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,7 @@ core::arch::global_asm!(
21
21
mrs lr, spsr // The hardware has copied the interrupted task's CPSR to SPSR_irq - grab it and
22
22
push {{ lr }} // save it to IRQ stack using LR
23
23
msr cpsr_c, {sys_mode} // switch to system mode so we can handle another interrupt (because if we interrupt irq mode we trash our own shadow registers)
24
+
push {{ lr }} // Save LR of system mode before using it for stack alignment
24
25
mov lr, sp // align SP down to eight byte boundary using LR
25
26
and lr, lr, 7 //
26
27
sub sp, lr // SP now aligned - only push 64-bit values from here
@@ -34,6 +35,7 @@ core::arch::global_asm!(
34
35
r#"
35
36
pop {{ r0-r3, r12, lr }} // restore alignment amount (in LR) and preserved registers
36
37
add sp, lr // restore SP alignment using LR
38
+
pop {{ lr }} // Restore the actual link register of system mode.
37
39
msr cpsr_c, {irq_mode} // switch back to IRQ mode (with IRQ masked)
0 commit comments