#include "string.h"
#include "irq.h"
+#include "hollywood.h"
extern char exception_2200_start, exception_2200_end;
{
// 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;
#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;
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. */
write32(OHCI0_HC_INT_ENABLE, OHCI_INTR_INIT);
- //irq_restore(cookie);
- _CPU_ISR_Restore(cookie);
-
+ irq_restore(cookie);
dbg_op_state();
-
}