I'm going through how FIQ works on ARM and came across the statement that FIQ should always be written in assembly not in C but couldn't understand why?
I have gone through the following link
http://comments.gmane.org/gmane.linux.ports.arm.kernel/14004
But still couldn't make out why is it required?
Can any one please point me out the need of writing FIQ in assembly through some example?
My guess is based on this:
Also, it's a little difficult to write the FIQ code in C, since you lack a stack :)
If there's no stack, that would mean that the compiler is restricted to only using registers for all variables, which I'm not sure how you'd even express.
You can put register
on all the local variables, but that doesn't mean that the compiler has to comply.
Writing the code in assembly of course goes around this restriction, and makes it possible to combine registers and global state to do things.
See also this question's answers for more about the difference between an ordinary interrupt and a fast one.