crazzy
crazzy

Reputation: 169

fiq handler for arm64

I am trying to write an FIQ handler for arm64(AArch64) in assembly. I already have written an IRQ handler which works well so far. I was just wondering if my FIQ handler should be different from what my IRQ looks like.

In AArh32 FIQ used to have banked registers R8-R12,LR,SP; which were not required to push onto stack. So this was one difference from IRQ in AArch32 where all registers(except LR,SP) were required to push onto stack.

But I couldn't find what registers are banked in arm64 (except LR & SP). Could someone please tell me what should go into my FIQ for arm64. Better if someone could direct me towards an example FIQ handler for arm64.

Upvotes: 2

Views: 1208

Answers (1)

Haonong Yu
Haonong Yu

Reputation: 11

Theoretically, you only need to save those registers clobbered in your interrupt handler. But from the perspective of generality, you should save all the general purpose registers (X0 to X30).

LR (Link Register) is the alias of X30 in arm64. You don't need to save SP, but you must make sure SP is unchanged while returning from FIQ handler, especially when you are programming the FIQ handler in assembly language. C compiler will take care of the stack pointer so you don't worry about that in C ISR.

Upvotes: 1

Related Questions