From: Bernhard Urban Date: Wed, 2 Sep 2009 22:46:29 +0000 (+0200) Subject: Merge branch 'isr_test' of git://github.com/theStack/ppcskel into isr_test X-Git-Tag: firstresponse~47 X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=0a6cd808a414dab189b1ffac82df6651dfb4ae34;hp=-c;p=ppcskel.git Merge branch 'isr_test' of git://github.com/theStack/ppcskel into isr_test Conflicts: ohci.c --- 0a6cd808a414dab189b1ffac82df6651dfb4ae34 diff --combined exception.c index f439b14,4a9eef3..b2c5373 --- a/exception.c +++ b/exception.c @@@ -12,7 -12,6 +12,7 @@@ Copyright (C) 2008 Segher Boessenkool #include "string.h" #include "irq.h" +#include "hollywood.h" extern char exception_2200_start, exception_2200_end; @@@ -20,12 -19,33 +20,18 @@@ 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; } + // check if exception happened due to the decrementer + if (exception == 0x900) { + printf("\nDecrementer exception occured - who cares?\n"); + return; + } + u32 *x; u32 i; diff --combined ohci.c index 33d6034,04550f9..1bab91a --- a/ohci.c +++ b/ohci.c @@@ -14,7 -14,8 +14,7 @@@ Copyright (C) 2009 Sebastian Falbes #include "irq.h" #define gecko_printf printf - #define dma_addr(address) (u32)address -#define set32(address, flags) write32(address, read32(address) | flags) + #define dma_addr(address) virt_to_phys(address) static struct ohci_hcca hcca_oh0; @@@ -69,7 -70,10 +69,7 @@@ void ohci_init() within 2msec else HC enters RESUME */ - //u32 cookie = irq_kill(); - u32 cookie; - _CPU_ISR_Disable(cookie); - + u32 cookie = irq_kill(); /* Tell the controller where the control and bulk lists are * The lists are empty now. */ @@@ -103,8 -107,11 +103,8 @@@ write32(OHCI0_HC_INT_ENABLE, OHCI_INTR_INIT); - //irq_restore(cookie); - _CPU_ISR_Restore(cookie); - + irq_restore(cookie); dbg_op_state(); - }