SVC Interrupt handler in assembly
Hello!
[Platform is Luminary Micro/TI, Cortex M3 - ARMv7]
To extract the immediate value of an SVC call, I need an interrupt handler (or at least a wrapper in assembly). ARM documentation suggests something like
TST LR,#4
ITE EQ
MRSEQ R0,MSP
MRSNE R0,PSP
Now, if I write a C handler and place that inside it compiles fine, but the C function around it breaks the stack situation I want to use. If I place that code in a S file, it won't compile. The compiler says that these instructions are not supported in Thumb mode, as is conditional execution. Which is clearly not true, as it executes when its wrapped in C.
So how to make the compiler use this kind of assembly function?
Greetz Josef
Please sign in to leave a comment.
Comments
2 comments