Changeset 604 for GPL/trunk/drv32/irq.c


Ignore:
Timestamp:
Jan 8, 2018, 2:07:36 AM (8 years ago)
Author:
David Azarewicz
Message:

Incorporated changes from Andy.
Added limited MSI support.

File:
1 edited

Legend:

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

    r587 r604  
    5151BOOL ALSA_SetIrq(ULONG ulIrq, ULONG ulSlotNo, BOOL fShared)
    5252{
    53     USHORT rc = 1;
     53  USHORT rc = 1;
    5454
    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  }
    5960
    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  }
    6665
    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  }
    7371
    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  }
    7978
    80     return TRUE;
     79  return TRUE;
    8180}
    8281
     
    8483BOOL ALSA_FreeIrq(ULONG ulIrq)
    8584{
    86     return (DevIRQClear((WORD16)ulIrq) == 0);
     85  return (DevIRQClear((WORD16)ulIrq) == 0);
    8786}
    8887
     
    9190ULONG ALSA_Interrupt(ULONG ulSlotNo)
    9291{
    93     ULONG       ulIrqNo;
     92  ULONG ulIrqNo;
    9493
    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;
    113113}
    114114
Note: See TracChangeset for help on using the changeset viewer.