/* ppcskel - a Free Software replacement for the Nintendo/BroadOn IOS. IRQ support Copyright (C) 2009 Bernhard Urban Copyright (C) 2009 Sebastian Falbesoner # This code is licensed to you under the terms of the GNU GPL, version 2; # see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt */ #include "irq.h" #include "hollywood.h" #include "ipc.h" #include "bootmii_ppc.h" #include "usb/host/host.h" #include "mini_ipc.h" void show_frame_no(void); void irq_initialize(void) { // 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); /* ??? -- needed?! * in mini they do * * write32(HW_ARMIRQMASK+0x04, 0); * write32(HW_ARMIRQMASK+0x20, 0); * * * may it's here following; on the other * hand it's already done by mini... * * write32(HW_PPCIRQMASK+0x04+0x08, 0); * write32(HW_PPCIRQMASK+0x20+0x08, 0); */ _CPU_ISR_Enable() } void irq_shutdown(void) { write32(HW_PPCIRQMASK, 0); write32(HW_PPCIRQFLAG, 0xffffffff); (void) irq_kill(); } void irq_handler(void) { u32 enabled = read32(BW_PI_IRQMASK); u32 flags = read32(BW_PI_IRQFLAG); flags = flags & enabled; if (flags & (1<