I am using S5PV210 which is based on ARM cortex-A8
When I declare an interrupt procedure as follows:
void isr_routine(void) __attribute__ ((interrupt ("IRQ")));
And compile it like
arm-linux-gcc -c -march=armv7-a -fpie -fno-builtin $< -o $@
I know gcc will switch the context for me by pressing some registers. Before I know this, I did it manually. So I am wondering how to do gcc. After disassembling, I found the codes as shown below
PUSH {r0-r4,r11,r12,lr}
This contradicts my concept of context switching. The official Arm cortex-A8 whitepaper clearly states that r0-r12 is separated by user mode and IRQ mode. However, lr in user mode is independent of IRQ mode. So I used a context like this to switch
PUSH {r0-r12}
Everything is good? Why is gcc push lr registered and why does gcc push r5-r10 not work?
source share