Merge branch 'isr_test' of git://github.com/theStack/ppcskel into isr_test
[ppcskel.git] / exception.c
index 095de44507780d28a82b3aed68c741d17f825036..b2c5373b2f50a7eaeee780b57c52774e24b7123a 100644 (file)
@@ -11,11 +11,27 @@ Copyright (C) 2008          Segher Boessenkool <segher@kernel.crashing.org>
 #include "bootmii_ppc.h"
 
 #include "string.h"
+#include "irq.h"
+#include "hollywood.h"
 
 extern char exception_2200_start, exception_2200_end;
 
 void exception_handler(int exception)
 {
+       // check if the exception was actually an interrupt
+       if (exception == 0x500) {
+               u32 cookie = irq_kill();
+               irq_handler();
+               irq_restore(cookie);
+               return;
+       }
+
+       // check if exception happened due to the decrementer
+       if (exception == 0x900) {
+               printf("\nDecrementer exception occured - who cares?\n");
+               return;
+       }
+
        u32 *x;
        u32 i;