libcortex_a9: add interrupt exit support for interrupt_handler macro #107
@ -66,7 +66,7 @@ macro_rules! interrupt_handler {
|
||||
concat!("movtne r1, :upper16:", stringify!($stack1)),
|
||||
"mov r0, sp",
|
||||
"mov sp, r1",
|
||||
"push {{r0, r1}}", // for stack alignment
|
||||
"push {{r0, r1}}", // 2 registers are pushed to maintain 8 byte stack alignment
|
||||
|
||||
concat!("bl ", stringify!($name2)),
|
||||
"pop {{r0, r1}}",
|
||||
"mov sp, r0",
|
||||
|
Loading…
Reference in New Issue
Block a user
Unclear what this "stack alignment" does exactly and why it is needed.
The arm doc state the stack need to be 8 byte align and the easiest way to do it is to push/pop in multiple of 2 registers.
When
push {{r0}}
is used with a timer interrupt, the wrpll satellite will result in the following error.Which I suspect the compiler assume the stack pointer is 8 byte alignment and mess up the dellocation.
Code comment needs to be expanded.