Merge branch 'isr_test' of git://github.com/theStack/ppcskel into isr_test
[ppcskel.git] / exception.c
index 4a9eef38b9b469a66e088632993dd67febca26bf..b2c5373b2f50a7eaeee780b57c52774e24b7123a 100644 (file)
@@ -12,6 +12,7 @@ Copyright (C) 2008            Segher Boessenkool <segher@kernel.crashing.org>
 
 #include "string.h"
 #include "irq.h"
+#include "hollywood.h"
 
 extern char exception_2200_start, exception_2200_end;
 
@@ -19,24 +20,9 @@ void exception_handler(int exception)
 {
        // check if the exception was actually an interrupt
        if (exception == 0x500) {
-               u32 cookie;
-
-               _CPU_ISR_Disable(cookie);
-               printf("\nInterrupt occured ;-) Which one? -> ");
-               u32 enabled = read32(BW_PI_IRQMASK);
-               u32 flags = read32(BW_PI_IRQFLAG);
-               flags = flags & enabled;
-               if (flags & (1<<1)) { // RESET
-                       write32(BW_PI_IRQFLAG, 1<<1);
-                       printf("RESET :)\n");
-               }
-               if (flags & (1<<14)) { // Hollywood-PIC IRQ
-                       write32(BW_PI_IRQFLAG, 1<<14);
-                       write32(HW_PPCIRQFLAG, ~0); // dirty
-                       printf("Hollywood-PIC :)\n");
-               }
-               _CPU_ISR_Restore(cookie);
-
+               u32 cookie = irq_kill();
+               irq_handler();
+               irq_restore(cookie);
                return;
        }