X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=exception.c;h=39a1654e6cfb6e77b1efbf6168b920670567aefd;hb=3a17a5742283d2510b6bdcf42dcb76cdb66d3770;hp=b2c5373b2f50a7eaeee780b57c52774e24b7123a;hpb=0a6cd808a414dab189b1ffac82df6651dfb4ae34;p=ppcskel.git diff --git a/exception.c b/exception.c index b2c5373..39a1654 100644 --- a/exception.c +++ b/exception.c @@ -18,43 +18,45 @@ extern char exception_2200_start, exception_2200_end; void exception_handler(int exception) { - // check if the exception was actually an interrupt + u32 cookie = irq_kill(); + // check if the exception was actually an external 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) { + 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 (;;) - ; + irq_restore(cookie); + _CPU_ISR_Enable(); //wtf } void exception_init(void)