3/12/2014
Your driver must register its interrupt service routine (ISR) with the kernel unless the driver relies on the OAL ISR function to handle its interrupt. The driver must register its ISR with the kernel so that the kernel calls the ISR when its associated physical interrupt occurs. If your driver does not register an ISR, a default ISR, which is installed by the OAL in OEMInit, handles any interrupts that the device generates.
If your device driver has an ISR, your device driver must perform the following actions when it loads:
- Register its ISR with the kernel.
- Map the interrupt request (IRQ) of the device to a unique SYSINTR.
To associate your ISR with your device, you register your ISR with the exception handler when you start the OS by including a call to HookInterrupt in OEMInit. To map an IRQ to a SYSINTR, you call OALIntrStaticTranslate in OEMInit. During boot, the kernel calls OEMInit in the OAL, and then OEMInit calls HookInterrupt to inform the exception handler of the address of your ISR and the IRQ that your ISR services. For more information about interrupt service routine registration, see HookInterrupt.
The interrupt handler registration process registers an event that is associated with the system interrupt SYSINTR. When your device driver starts, it creates an interrupt service thread (IST), and then calls InterruptInitialize to register this event. The IST can then use WaitForSingleObject to wait on this event and register it with the interrupt handler. You can register your IST for one or more logical interrupts (SYSINTRs).
If your device driver must stop processing an interrupt, call the InterruptDisable function. When your driver calls this function, the interrupt handler removes the association between the IST and the specified logical interrupt. The interrupt handler accomplishes this by calling the OEMInterruptDisable function to turn off the interrupt. If necessary, you can register for the interrupt again.