From 3a17a5742283d2510b6bdcf42dcb76cdb66d3770 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Thu, 3 Sep 2009 20:10:10 +0200 Subject: [PATCH] WIP: irq handler hw-pic still don't work, but the irq #14 will be cleared... maybe all hw-ppc-flags should be cleared -- how?! write32(HW_PPCIRQFLAG, ~0); don't work :( --- exception.c | 7 ++++--- irq.c | 40 +++++++++++++++++++--------------------- main.c | 13 +++++++------ 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/exception.c b/exception.c index 2d7451e..39a1654 100644 --- a/exception.c +++ b/exception.c @@ -18,12 +18,10 @@ extern char exception_2200_start, exception_2200_end; void exception_handler(int exception) { + 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); - //_CPU_ISR_Enable(); //wtf } // check if exception happened due to the decrementer @@ -56,6 +54,9 @@ void exception_handler(int exception) for (;;) ; } + + irq_restore(cookie); + _CPU_ISR_Enable(); //wtf } void exception_init(void) diff --git a/irq.c b/irq.c index 1c5902b..da2456b 100644 --- a/irq.c +++ b/irq.c @@ -19,19 +19,20 @@ Copyright (C) 2009 Andre Heider "dhewg" void irq_initialize(void) { - // enable hollywood-pic for ppc + // clear flipper-pic (processor interface) + write32(BW_PI_IRQMASK, 0); + write32(BW_PI_IRQFLAG, 0xffffffff); + + // clear hollywood-pic 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); + printf("PPCIRQMASK: 0x%08X\n", read32(HW_PPCIRQMASK)); + //??? -- needed?! - /* write32(HW_PPCIRQMASK+0x04, 0); write32(HW_PPCIRQMASK+0x20, 0); - */ _CPU_ISR_Enable() } @@ -51,11 +52,11 @@ void irq_handler(void) flags = flags & enabled; - if (flags & (1<<1)) { //RESET + if (flags & (1<> 16 & 0xFFFF; u16 mini_version_minor = version & 0xFFFF; -- 2.25.1