12 #ifndef interrupt_utils_
13 #define interrupt_utils_
30 #define RAMFUNC __attribute__ ((long_call, section (".fastrun")))
41 #define INTFUNC __attribute__ ((interrupt("IRQ")))
51 #define NACKEDFUNC __attribute__((naked))
66 #define ISR_STORE() asm volatile( \
67 "STMDB SP!,{R0-R12,LR}\n" )
82 #define ISR_RESTORE() asm volatile( \
83 "LDMIA SP!,{R0-R12,LR}\n" \
84 "SUBS R15,R14,#0x0004\n" )
96 #define ISR_ENABLE_NEST() asm volatile( \
98 "STMFD SP!, {LR} \n" \
99 "MSR CPSR_c, #0x1f \n" \
112 #define ISR_DISABLE_NEST() asm volatile( \
113 "LDMFD SP!, {LR} \n" \
114 "MSR CPSR_c, #0x92 \n" \
115 "LDMFD SP!, {LR} \n" \
116 "MSR SPSR_cxsf, LR \n" )
147 #define ISR_ENTRY() asm volatile(" sub lr, lr,#4\n" \
148 " stmfd sp!,{r0-r12,lr}\n" \
168 #define ISR_EXIT() asm volatile(" ldmfd sp!,{r1}\n" \
170 " ldmfd sp!,{r0-r12,pc}^")
186 unsigned disableIRQ(
void);
202 unsigned enableIRQ(
void);
219 unsigned restoreIRQ(
unsigned oldCPSR);
235 unsigned disableFIQ(
void);
251 unsigned enableFIQ(
void);
268 unsigned restoreFIQ(
unsigned oldCPSR);