Changeset 63 for GPL/trunk/drv32/irq.cpp
- Timestamp:
- Jan 3, 2006, 11:33:10 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/drv32/irq.cpp
r34 r63 35 35 36 36 // List of handlers here. 37 static FARPTR16 *pISR[ NUM_IRQLEVELS] = {38 NULL,39 NULL,40 NULL,37 static FARPTR16 *pISR[MAX_IRQ_SLOTS] = { 38 &ISR00, 39 &ISR01, 40 &ISR02, 41 41 &ISR03, 42 42 &ISR04, 43 43 &ISR05, 44 NULL, 45 &ISR07, 46 NULL, 47 &ISR09, 48 &ISR10, 49 &ISR11, 50 &ISR12, 51 &ISR13, 52 &ISR14, 53 &ISR15, 44 &ISR06, 45 &ISR07 54 46 }; 55 56 static PFNIRQ pfnAlsaIRQHandler = NULL;57 47 58 48 //****************************************************************************** 59 49 //****************************************************************************** 60 BOOL RMSetIrq(ULONG ulIrq, BOOL fShared, PFNIRQ pfnIrqHandler)50 BOOL ALSA_SetIrq(ULONG ulIrq, ULONG ulSlotNo, BOOL fShared) 61 51 { 62 52 USHORT rc = 1; 63 53 64 if( pISR[ulIrq] == NULL) {54 if( ulSlotNo >= MAX_IRQ_SLOTS ) { 65 55 DebugInt3(); 66 56 return FALSE; 67 57 } 68 if(fShared) 58 59 if(fShared) 69 60 { 70 rc = DevIRQSet((WORD16) *pISR[ ulIrq],61 rc = DevIRQSet((WORD16) *pISR[ulSlotNo], 71 62 (WORD16)ulIrq, 72 63 1 ); // first try shared shared 73 64 } 65 74 66 if (rc != 0) { // If error ... 75 rc = DevIRQSet((WORD16) *pISR[ ulIrq],67 rc = DevIRQSet((WORD16) *pISR[ulSlotNo], 76 68 (WORD16)ulIrq, 77 69 0); // failed, so try exclusive instead 78 70 } 71 79 72 if (rc != 0) { // If error ... 80 dprintf(("ERROR: RMSetIrq %d %d %x FAILED!!", ulIrq, fShared, pfnIrqHandler));73 dprintf(("ERROR: RMSetIrq %d %d %x FAILED!!", ulIrq, fShared, ulSlotNo)); 81 74 DebugInt3(); 82 75 return FALSE; 83 76 } 84 //Always called with the same handler 85 if(pfnAlsaIRQHandler && (pfnAlsaIRQHandler != pfnIrqHandler)) { 86 DebugInt3(); 87 return FALSE; 88 } 89 pfnAlsaIRQHandler = pfnIrqHandler; 77 90 78 return TRUE; 91 79 } 92 80 //****************************************************************************** 93 81 //****************************************************************************** 94 BOOL RMFreeIrq(ULONG ulIrq)82 BOOL ALSA_FreeIrq(ULONG ulIrq) 95 83 { 96 84 return (DevIRQClear((WORD16)ulIrq) == 0); … … 98 86 //****************************************************************************** 99 87 //****************************************************************************** 100 ULONG ALSA_Interrupt(ULONG irqnr);88 ULONG ALSA_Interrupt(ULONG ulSlotNo); 101 89 #pragma aux ALSA_Interrupt "ALSA_Interrupt" parm [ebx] 102 ULONG ALSA_Interrupt(ULONG irqnr)90 ULONG ALSA_Interrupt(ULONG ulSlotNo) 103 91 { 104 if(pfnAlsaIRQHandler == NULL) { 105 DebugInt3(); 106 return FALSE; 107 } 108 #ifdef DEBUG 109 dprintf2(("irq %d",irqnr)); 110 #endif 111 if(pfnAlsaIRQHandler(irqnr)) { 112 cli(); 113 // We've cleared all service requests. Send EOI and clear 114 // the carry flag (tells OS/2 kernel that Int was handled). 115 DevEOI( (WORD16)irqnr ); 116 return TRUE; 92 ULONG ulIrqNo; 93 94 if( process_interrupt(ulSlotNo, &ulIrqNo) ) { 95 cli(); 96 // We've cleared all service requests. Send EOI and clear 97 // the carry flag (tells OS/2 kernel that Int was handled). 98 DevEOI( (WORD16)ulIrqNo ); 99 return TRUE; 117 100 } 118 101 // Indicate Interrupt not serviced by setting carry flag before
Note:
See TracChangeset
for help on using the changeset viewer.