Changeset 63 for GPL/trunk/drv32/irq.cpp


Ignore:
Timestamp:
Jan 3, 2006, 11:33:10 PM (20 years ago)
Author:
vladest
Message:

(Patches by Ruediger Ihle)
Support for IRQs > 15
Fixed resource manager registration
Fixed crash on APM suspend/resume and system shutdown

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/drv32/irq.cpp

    r34 r63  
    3535
    3636// List of handlers here.
    37 static FARPTR16 *pISR[NUM_IRQLEVELS] = {
    38    NULL,
    39    NULL,
    40    NULL,
     37static FARPTR16 *pISR[MAX_IRQ_SLOTS] = {
     38   &ISR00,
     39   &ISR01,
     40   &ISR02,
    4141   &ISR03,
    4242   &ISR04,
    4343   &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
    5446};
    55 
    56 static PFNIRQ pfnAlsaIRQHandler = NULL;
    5747
    5848//******************************************************************************
    5949//******************************************************************************
    60 BOOL RMSetIrq(ULONG ulIrq, BOOL fShared, PFNIRQ pfnIrqHandler)
     50BOOL ALSA_SetIrq(ULONG ulIrq, ULONG ulSlotNo, BOOL fShared)
    6151{
    6252    USHORT rc = 1;
    6353
    64     if(pISR[ulIrq] == NULL) {
     54    if( ulSlotNo >= MAX_IRQ_SLOTS ) {
    6555        DebugInt3();
    6656        return FALSE;
    6757    }
    68     if(fShared)
     58
     59    if(fShared)
    6960    {
    70         rc = DevIRQSet((WORD16) *pISR[ ulIrq ],
     61        rc = DevIRQSet((WORD16) *pISR[ulSlotNo],
    7162                       (WORD16)ulIrq,
    7263                       1 );   // first try shared shared
    7364    }
     65
    7466    if (rc != 0) {                    // If error ...
    75         rc = DevIRQSet((WORD16) *pISR[ ulIrq ],
     67        rc = DevIRQSet((WORD16) *pISR[ulSlotNo],
    7668                       (WORD16)ulIrq,
    7769                       0);   // failed, so try exclusive instead
    7870    }
     71
    7972    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));
    8174        DebugInt3();
    8275        return FALSE;
    8376    }
    84     //Always called with the same handler
    85     if(pfnAlsaIRQHandler && (pfnAlsaIRQHandler != pfnIrqHandler)) {
    86         DebugInt3();
    87         return FALSE;
    88     }
    89     pfnAlsaIRQHandler = pfnIrqHandler;
     77
    9078    return TRUE;
    9179}
    9280//******************************************************************************
    9381//******************************************************************************
    94 BOOL RMFreeIrq(ULONG ulIrq)
     82BOOL ALSA_FreeIrq(ULONG ulIrq)
    9583{
    9684    return (DevIRQClear((WORD16)ulIrq) == 0);
     
    9886//******************************************************************************
    9987//******************************************************************************
    100 ULONG ALSA_Interrupt(ULONG irqnr);
     88ULONG ALSA_Interrupt(ULONG ulSlotNo);
    10189#pragma aux ALSA_Interrupt "ALSA_Interrupt" parm [ebx]
    102 ULONG ALSA_Interrupt(ULONG irqnr)
     90ULONG ALSA_Interrupt(ULONG ulSlotNo)
    10391{
    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;
    117100   }
    118101   // Indicate Interrupt not serviced by setting carry flag before
Note: See TracChangeset for help on using the changeset viewer.