Split test suite in new file.
[bertos.git] / cpu / arm / drv / sysirq_at91.c
index 4beaf3617cbc320d15fa48a5b7f8ec8cfe7311bc..281c7963f8afdbee1fb0fc472ca961a3171cd921 100644 (file)
@@ -54,7 +54,8 @@
 
 #include "sysirq_at91.h"
 #include <io/arm.h>
-#include <cpu/cpu.h>
+#include <cpu/irq.h>
+#include <cpu/types.h>
 #include <cfg/module.h>
 #include <cfg/macros.h>
 
@@ -93,10 +94,9 @@ STATIC_ASSERT(countof(sysirq_tab) == SYSIRQ_CNT);
  * various sources (system timer, etc..) and calls
  * the corresponding handler.
  */
-static void sysirq_dispatcher(void) __attribute__ ((naked));
+static void sysirq_dispatcher(void) __attribute__ ((interrupt));
 static void sysirq_dispatcher(void)
 {
-       IRQ_ENTRY();
        for (unsigned i = 0; i < countof(sysirq_tab); i++)
        {
                if (sysirq_tab[i].enabled
@@ -104,7 +104,8 @@ static void sysirq_dispatcher(void)
                        sysirq_tab[i].handler();
        }
 
-       IRQ_EXIT();
+       /* Inform hw that we have served the IRQ */
+       AIC_EOICR = 0;
 }
 
 #define SYSIRQ_PRIORITY 0 ///< default priority for system irqs.