static void sysirq_dispatcher(void)
{
IRQ_ENTRY();
-
- /* PIT */
- if ((PIT_MR & BV(PITIEN))
- && (PIT_SR & BV(PITS))
- && sysirq_tab[SYSIRQ_PIT].handler)
- sysirq_tab[SYSIRQ_PIT].handler();
-
- /* TODO: add other system sources here */
+ for (unsigned i = 0; i < countof(sysirq_tab); i++)
+ {
+ if (sysirq_tab[i].enabled
+ && sysirq_tab[i].handler)
+ sysirq_tab[i].handler();
+ }
IRQ_EXIT();
}
IRQ_SAVE_DISABLE(flags);
/* Disable all system interrupts */
- PIT_MR &= BV(PITIEN);
- /* TODO: add other system sources here */
+ for (unsigned i = 0; i < countof(sysirq_tab); i++)
+ sysirq_tab[i].setEnable(false);
/* Set the vector. */
AIC_SVR(SYSC_ID) = sysirq_dispatcher;