libcortex_a9: add interrupt exit support for interrupt_handler macro #107
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "morgan/zynq-rs:interrupt"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
add interrupt exit support for interrupt_handler macro
$name2
function$name2
function, registers r0-r12, PC, SP and CPSR will be restored and return to the status before interrupt$name2
function to returnadd interrupt return test to experiment for core0
Compilation check
nix build <variant>
for szl, coraz7-experiments, zc706-experiments and kasli_soc-experiments. All compiled without warningNew experiment log
@ -56,1 +57,4 @@
// setup SP, depending on CPU 0 or 1
// and preserve registers
"SUB lr, lr, #4",
"STMFD sp!, {{r0-r12, lr}}",
Nitpicking but the other instructions are lower-case.
@ -62,2 +66,4 @@
concat!("movtne r1, :upper16:", stringify!($stack1)),
"mov r0, sp",
"mov sp, r1",
"push {{r0, r1}}", // for stack alignment
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.
Generally looks good! Is this the recommended way to handle interrupts according to the ARM docs?
Yes I followed this "Exit from an exception handler" from arm when making this patch