Share via


Configuring, Registering, and Deregistering an Interrupt Handler (Windows Embedded CE 6.0)

1/6/2010

A device driver must perform the following actions when its loads:

  • Register its ISR with the kernel.
    The driver must register its ISR with the kernel unless the driver relies on the common OAL ISR function to handle its interrupt. The driver must register its ISR with the kernel so that the kernel calls the ISR when the appropriate physical interrupt occurs.
  • Make an IRQ to SYSINTR mapping in the OAL's OEMInit function.
    -or-
    The bus driver that loads the driver must make an IRQ to SYSINTR mapping, which is the case with PCI bus driver.

If the driver does not install an ISR, any interrupts generated by the device are handled by a default ISR, which is installed by the OAL in OEMInit.

The interrupt handler registration process registers an event that is associated with the system interrupt SYSINTR. After a device driver is loaded, the driver creates an interrupt service thread (IST), and then calls InterruptInitialize to register the event. The IST can then use WaitForSingleObject to wait on this event and register it with the interrupt handler. The IST is registered for one or more logical interrupts (SYSINTRs).

If you use the Microsoft implementation of model device driver (MDD) for a particular driver, you do not have to write code to register the interrupt. The MDD layer of the driver registers the driver for interrupts. If you write a monolithic driver, you must implement code for registering the IST of the driver with the interrupt handler. To do this, use the CreateEvent function to create an event and the InterruptInitialize function to associate the event with a SYSINTR.

If a device driver must stop processing an interrupt, the driver must use the InterruptDisable function. When the 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. The driver can register for the interrupt again later, if necessary.

See Also

Other Resources

Interrupt Handling
Defining an Interrupt Identifier
Implementing an ISR
Loader
PCI Bus Driver
Real-Time Priority System