1 #include <sys-interrupt.h>
2 #include <interrupt-utils.h>
3 #include <AT91SAM7S64.h>
12 static SystemInterruptHandler *handlers =
NULL;
18 system_int_safe (
void)
20 SystemInterruptHandler *h;
23 if (h->handler())
break;
28 static void NACKEDFUNC ATTR
37 static unsigned int enabled = 0;
40 #define DIS_INT *AT91C_AIC_IDCR = (1 << AT91C_ID_SYS)
41 #define EN_INT if (enabled > 0) *AT91C_AIC_IECR = (1 << AT91C_ID_SYS)
44 sys_interrupt_enable()
48 AT91C_AIC_SMR[AT91C_ID_SYS] = AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL | 5;
50 AT91C_AIC_SVR[AT91C_ID_SYS] = (
unsigned long) system_int;
58 sys_interrupt_disable()
66 sys_interrupt_append_handler(SystemInterruptHandler *handler)
68 SystemInterruptHandler **h = &handlers;
79 sys_interrupt_prepend_handler(SystemInterruptHandler *handler)
82 handler->next = handlers;
88 sys_interrupt_remove_handler(SystemInterruptHandler *handler)
90 SystemInterruptHandler **h = &handlers;