/* $Id: irq.c,v 1.1.1.1 2003/07/02 13:57:02 eleph Exp $ */ /* * OS/2 implementation of Linux irq kernel services * * (C) 2000-2002 InnoTek Systemberatung GmbH * (C) 2000-2001 Sander van Leeuwen (sandervl@xs4all.nl) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, * USA. * */ #include "linux.h" #include #include #include #include #define LINUX #include #include #include #include #include "irqos2.h" static IRQHANDLER_INFO irqHandlers[MAX_IRQS][MAX_SHAREDIRQS] = {0}; static ULONG nrIrqHandlers[MAX_IRQS] = {0}; static ULONG eoiIrq[MAX_IRQS] = {0}; BOOL fInInterrupt = FALSE; extern BOOL fSuspended; //pci.c //****************************************************************************** //****************************************************************************** int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long x0, const char *x1, void *x2) { int i; if(RMRequestIRQ(hResMgr, irq, (x0 & SA_SHIRQ) ? TRUE : FALSE) == FALSE) { dprintf(("RMRequestIRQ failed for irq %d", irq)); return NULL; } if(irq > 0xF) { DebugInt3(); return 0; } for(i=0;i 0xf) { DebugInt3(); return; } eoiIrq[irq]++; } //****************************************************************************** //****************************************************************************** BOOL oss_process_interrupt(int irq) { BOOL rc; int i; #ifdef DEBUG // dprintf(("int proc")); #endif if(fSuspended) {//If our device is suspended, then we can't receive interrupts, so it must //be for some other device //Don't pass it to the linux handler as the device doesn't respond as expected //when suspended #ifdef DEBUG dprintf(("IRQ %d suspended",irq)); #endif return FALSE; } for(i=0;i 0); fInInterrupt = FALSE; if(rc) { //ok, this interrupt was intended for us; notify the 16 bits MMPM/2 driver OSS32_ProcessIRQ(); eoiIrq[irq] = 0; return TRUE; } } } return FALSE; } //****************************************************************************** //****************************************************************************** int in_interrupt() { return fInInterrupt; } //****************************************************************************** //****************************************************************************** void disable_irq(int irq) { dprintf(("disable_irq %d NOT implemented", irq)); } //****************************************************************************** //******************************************************************************