From: Bernhard Urban Date: Thu, 3 Sep 2009 00:17:32 +0000 (+0200) Subject: WIP: irq_handler X-Git-Tag: firstresponse~46 X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=ppcskel.git;a=commitdiff_plain;h=cbb2f30692a3d5cb7817aaa95dc14f8db24f5adb WIP: irq_handler --- diff --git a/exception.c b/exception.c index b2c5373..2d7451e 100644 --- a/exception.c +++ b/exception.c @@ -18,43 +18,44 @@ extern char exception_2200_start, exception_2200_end; void exception_handler(int exception) { - // check if the exception was actually an interrupt + // check if the exception was actually an external interrupt if (exception == 0x500) { u32 cookie = irq_kill(); irq_handler(); irq_restore(cookie); - return; + //_CPU_ISR_Enable(); //wtf } // check if exception happened due to the decrementer - if (exception == 0x900) { + else if (exception == 0x900) { printf("\nDecrementer exception occured - who cares?\n"); - return; } - u32 *x; - u32 i; + else { + u32 *x; + u32 i; - printf("\nException %04x occurred!\n", exception); + printf("\nException %04X occurred!\n", exception); - x = (u32 *)0x80002000; + x = (u32 *)0x80002000; - printf("\n R0..R7 R8..R15 R16..R23 R24..R31\n"); - for (i = 0; i < 8; i++) { - printf("%08x %08x %08x %08x\n", x[0], x[8], x[16], x[24]); - x++; - } - x = (u32 *)0x80002080; + printf("\n R0..R7 R8..R15 R16..R23 R24..R31\n"); + for (i = 0; i < 8; i++) { + printf("%08x %08x %08x %08x\n", x[0], x[8], x[16], x[24]); + x++; + } + x = (u32 *)0x80002080; - printf("\n CR/XER LR/CTR SRR0/SRR1 DAR/DSISR\n"); - for (i = 0; i < 2; i++) { - printf("%08x %08x %08x %08x\n", x[0], x[2], x[4], x[6]); - x++; - } + printf("\n CR/XER LR/CTR SRR0/SRR1 DAR/DSISR\n"); + for (i = 0; i < 2; i++) { + printf("%08x %08x %08x %08x\n", x[0], x[2], x[4], x[6]); + x++; + } - // Hang. - for (;;) - ; + // Hang. + for (;;) + ; + } } void exception_init(void) diff --git a/irq.c b/irq.c index 9ab1559..1c5902b 100644 --- a/irq.c +++ b/irq.c @@ -19,19 +19,19 @@ Copyright (C) 2009 Andre Heider "dhewg" void irq_initialize(void) { - // enable OHCI0 interrupt on hollywood-pic + // enable hollywood-pic for ppc write32(HW_PPCIRQMASK, 0); write32(HW_PPCIRQFLAG, 0xffffffff); // enable RESET and PIC (#14) interrupts on processor interface + write32(BW_PI_IRQMASK, 0); write32(BW_PI_IRQFLAG, 0xffffffff); -#define BW_PI_IRQ_RESET 1 -#define BW_PI_IRQ_HW 14 - write32(BW_PI_IRQMASK, (1<