I am new to ARM and learning about interrupt handling in ARM. I have read about how to set up IRQ handler in ARM but not sure how I write it in ARM assembly. Below is my understanding on setting up IRQ handler.
_IRQ_HANDER:
1) SUB lr, lr, #4
(Not sure what it do).
2) Would set up separate stack should be used in IRQ Mode. I know in x86 we set up stack like below:
push ebp
mov esp,ebp
sub esp,8
This will resrve 8 bytes of stack space.
But not sure how I do the same in ARM?
3) Store the non-banked register, we can do it this way:
STMFD !sp {r13,r14}
4) Copy the CPSR
to SPSR
(how can I do it ARM assembly?)
5) Move to Processors IRQ mode (I am ok doing this in ARM assembly).
6) What is Next step?
Do we need to give the base address of PIC?
I am working with ARMV7 architecture.