Changeset 604 for GPL/trunk/drv32/irq.c
- Timestamp:
- Jan 8, 2018, 2:07:36 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/drv32/irq.c
r587 r604 51 51 BOOL ALSA_SetIrq(ULONG ulIrq, ULONG ulSlotNo, BOOL fShared) 52 52 { 53 53 USHORT rc = 1; 54 54 55 if( ulSlotNo >= MAX_IRQ_SLOTS ) { 56 DebugInt3(); 57 return FALSE; 58 } 55 if( ulSlotNo >= MAX_IRQ_SLOTS ) 56 { 57 DebugInt3(); 58 return FALSE; 59 } 59 60 60 if(fShared) 61 { 62 rc = DevIRQSet((WORD16) *pISR[ulSlotNo], 63 (WORD16)ulIrq, 64 1 ); // first try shared shared 65 } 61 if(fShared) 62 { 63 rc = DevIRQSet((WORD16) *pISR[ulSlotNo], (WORD16)ulIrq, 1 ); // first try shared shared 64 } 66 65 67 if (rc != 0) { // If error ... 68 rprintf(("ERROR: RMSetIrq %d %d %x - failed to set shared - trying exclusive!!", ulIrq, fShared, ulSlotNo)); 69 rc = DevIRQSet((WORD16) *pISR[ulSlotNo], 70 (WORD16)ulIrq, 71 0); // failed, so try exclusive instead 72 } 66 if (rc != 0) 67 { // If error ... 68 rprintf(("ERROR: RMSetIrq %d %d %x - failed to set shared - trying exclusive!!", ulIrq, fShared, ulSlotNo)); 69 rc = DevIRQSet((WORD16) *pISR[ulSlotNo], (WORD16)ulIrq, 0); // failed, so try exclusive instead 70 } 73 71 74 if (rc != 0) { // If error ... 75 rprintf(("ERROR: RMSetIrq %d %d %x FAILED shared and exclusive mode!!", ulIrq, fShared, ulSlotNo)); 76 DebugInt3(); 77 return FALSE; 78 } 72 if (rc != 0) 73 { // If error ... 74 rprintf(("ERROR: RMSetIrq %d %d %x FAILED shared and exclusive mode!!", ulIrq, fShared, ulSlotNo)); 75 DebugInt3(); 76 return FALSE; 77 } 79 78 80 79 return TRUE; 81 80 } 82 81 … … 84 83 BOOL ALSA_FreeIrq(ULONG ulIrq) 85 84 { 86 85 return (DevIRQClear((WORD16)ulIrq) == 0); 87 86 } 88 87 … … 91 90 ULONG ALSA_Interrupt(ULONG ulSlotNo) 92 91 { 93 ULONGulIrqNo;92 ULONG ulIrqNo; 94 93 95 // enable interrupts that have higher priority we should 96 // allow higher priority interrupts 97 sti(); 98 if( process_interrupt(ulSlotNo, &ulIrqNo) ) { 99 DbgInt.ulIntServiced[DbgInt.ulState]++; 100 // We've cleared all service requests. 101 // Clear (disable) Interrupts, Send EOI 102 // and clear the carry flag (tells OS/2 kernel that Int was handled). 103 // Note carry flag is handled in setup.asm 104 cli(); 105 DevEOI( (WORD16)ulIrqNo ); 106 return TRUE; 107 } 108 DbgInt.ulIntUnserviced[DbgInt.ulState]++; 109 // Indicate Interrupt not serviced by setting carry flag before 110 // returning to OS/2 kernel. OS/2 will then shut down the interrupt! 111 // NOTE: Make sure interrupts are not turned on again when this irq isn't ours! 112 return FALSE; 94 // enable interrupts that have higher priority we should 95 // allow higher priority interrupts 96 sti(); 97 if( process_interrupt(ulSlotNo, &ulIrqNo) ) 98 { 99 DbgInt.ulIntServiced[DbgInt.ulState]++; 100 // We've cleared all service requests. 101 // Clear (disable) Interrupts, Send EOI 102 // and clear the carry flag (tells OS/2 kernel that Int was handled). 103 // Note carry flag is handled in setup.asm 104 cli(); 105 DevEOI( (WORD16)ulIrqNo ); 106 return TRUE; 107 } 108 DbgInt.ulIntUnserviced[DbgInt.ulState]++; 109 // Indicate Interrupt not serviced by setting carry flag before 110 // returning to OS/2 kernel. OS/2 will then shut down the interrupt! 111 // NOTE: Make sure interrupts are not turned on again when this irq isn't ours! 112 return FALSE; 113 113 } 114 114
Note:
See TracChangeset
for help on using the changeset viewer.