Jonathan Brandmeyer writes:
> How much of this work is done by the GCC function
> __attribute__((interrupt("FIQ")))?
Interesting, thanks. It seems to save registers and return as required.
You'd need to initialize pt_regs.ARM_sp with set_fiq_regs() first.
Some people used to say it was broken, but hopefully it has been
fixed since then ( http://gcc.gnu.org/ml/gcc/2003-01/msg00985.html ).
Note that it writes 9 registers to the stack before your code has a
chance to run. So I'll keep using assembly code whenever latency is
critical (for instance, to read a timestamp as soon as possible).
-- Pascal
0000049c <rtstub2>:
49c: e52dc004 str ip, [sp, #-4]!
4a0: e1a0c00d mov ip, sp
4a4: e92dd80f stmdb sp!, {r0, r1, r2, r3, fp, ip, lr, pc}
4a8: e24cb004 sub fp, ip, #4 ; 0x4
4ac: e3a00000 mov r0, #0 ; 0x0
4b0: ebfffffe bl 4b0 <rtstub2+0x14>
4b4: e2800001 add r0, r0, #1 ; 0x1
4b8: e89d680f ldmia sp, {r0, r1, r2, r3, fp, sp, lr}
4bc: e8bd1000 ldmia sp!, {ip}
4c0: e25ef004 subs pc, lr, #4 ; 0x4
|