Annotation of ntddk/src/mmedia/sndblst/driver/isr.c, revision 1.1.1.1

1.1       root        1: /*++
                      2: 
                      3: Copyright (c) 1991  Microsoft Corporation
                      4: 
                      5: Module Name:
                      6: 
                      7:     isr.c
                      8: 
                      9: Abstract:
                     10: 
                     11:     This module contains code for the interrupt service routine
                     12:     for the SoundBlaster device driver.
                     13: 
                     14: Author:
                     15: 
                     16:     Nigel Thompson (nigelt) 7-March-1991
                     17: 
                     18: Environment:
                     19: 
                     20:     Kernel mode
                     21: 
                     22: Revision History:
                     23: 
                     24:     Robin Speed (RobinSp) 29-Jan-1992
                     25:            Add MIDI and Soundblaster 1 support.
                     26: 
                     27: --*/
                     28: 
                     29: #include "sound.h"
                     30: 
                     31: //
                     32: // Driver ISR
                     33: //
                     34: // When we get here, we acknowledge the interrupt from the
                     35: // DSP and simply let the defered processing routine take over
                     36: // to complete the task.
                     37: //
                     38: // NOTE: If we were to be doing MIDI input, we would read the
                     39: // data port to extract the received character and save it.
                     40: //
                     41: // That was NigelT's note - currently MIDI input reads the
                     42: // byte in the Dpc routine - hasn't failed yet - RCBS
                     43: //
                     44: 
                     45: #if DBG
                     46: ULONG sndBogusInterrupts = 0;
                     47: #endif // DBG
                     48: 
                     49: //
                     50: // Internal routine
                     51: //
                     52: 
                     53: VOID
                     54: SoundReProgramDMA(
                     55:     IN OUT PWAVE_INFO WaveInfo
                     56: )
                     57: ;
                     58: 
                     59: BOOLEAN
                     60: SoundISR(
                     61:     IN    PKINTERRUPT pInterrupt,
                     62:     IN    PVOID Context
                     63: )
                     64: /*++
                     65: 
                     66: Routine Description:
                     67: 
                     68:     Interrupt service routine for the soundblaster card.
                     69: 
                     70: Arguments:
                     71: 
                     72:     pInterrupt - our interrupt
                     73:     Contest - Pointer to our global device info
                     74: 
                     75: 
                     76: Return Value:
                     77: 
                     78:     TRUE if we handled the interrupt
                     79: 
                     80: --*/
                     81: {
                     82:     PGLOBAL_DEVICE_INFO pGDI;
                     83:     BOOLEAN Result;
                     84:        PSOUND_HARDWARE pHw;
                     85: 
                     86:     pGDI = (PGLOBAL_DEVICE_INFO)Context;
                     87:     ASSERT(pGDI->Key == GDI_KEY);
                     88: 
                     89:        pHw = &pGDI->Hw;
                     90: 
                     91:     dprintf5(("<"));
                     92: 
                     93:     //
                     94:     // Acknowledge the interrupt from the DSP
                     95:     //
                     96: 
                     97:     INPORT(pHw, DATA_AVAIL_PORT);
                     98: 
                     99:     //
                    100:     // See who the interrupt is for and request the
                    101:     // appropriate defered routine
                    102:     //
                    103: 
                    104:     Result = TRUE;
                    105:     switch (pGDI->Usage) {
                    106:     case WaveInDevice:
                    107:         dprintf5(("i"));
                    108:         IoRequestDpc(pGDI->DeviceObject[WaveInDevice],
                    109:                      NULL,
                    110:                      NULL);
                    111:         break;
                    112: 
                    113:     case WaveOutDevice:
                    114:         dprintf5(("o"));
                    115:         IoRequestDpc(pGDI->DeviceObject[WaveOutDevice],
                    116:                      NULL,
                    117:                      NULL);
                    118:         break;
                    119: 
                    120:     case MidiInDevice:
                    121:         // get all MIDI input chars available and save them for the DPC
                    122:         // start the midi in dpc
                    123:         IoRequestDpc(pGDI->DeviceObject[MidiInDevice],
                    124:                      NULL,
                    125:                      NULL);
                    126:         break;
                    127: 
                    128:     default:
                    129:         //
                    130:         // Set interrupts in case of autodetect.
                    131:         //
                    132:         pGDI->InterruptsReceived++;
                    133: #if DBG
                    134:         // We only get 10 valid interrupts when we test the interrupt
                    135:         // for validity in init.c.  If we get lots more here there
                    136:         // may be a problem.
                    137: 
                    138:         sndBogusInterrupts++;
                    139:         if ((sndBogusInterrupts % 20) == 0) {
                    140:             dprintf(("%u bogus interrupts so far", sndBogusInterrupts - 10));
                    141:         }
                    142: #endif // DBG
                    143: 
                    144:         //
                    145:         // Set the return value to FALSE to say we didn't
                    146:         // handle the interrupt.
                    147:         //
                    148: 
                    149:         Result = FALSE;
                    150: 
                    151:         break;
                    152:     }
                    153: 
                    154:     dprintf5((">"));
                    155: 
                    156:     return Result;
                    157: 
                    158:     DBG_UNREFERENCED_PARAMETER(pInterrupt);
                    159: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.