Interrupt Objects

< BACK  NEXT >
[oR]

The last kernel object described in this chapter is the interrupt object. Interrupt objects simply give the kernel's interrupt dispatcher a way to find the right service routine when an interrupt occurs. The life cycle of an interrupt object is described below.

  1. The DriverEntry or AddDevice routine creates an interrupt object for each interrupt vector supported by the device or the controller.

  2. When an interrupt occurs, the kernel's interrupt dispatcher uses the Interrupt object to locate the Interrupt Service routine.

  3. The Unload or RemoveDevice routine deletes the interrupt object after disabling interrupts from the device.

A driver does not interact with interrupt objects other than to create and delete them. A pointer to the interrupt object is typically stored in the device extension or controller extension.

Layout of an Interrupt Object

Figure 4.6 illustrates the structure of an interrupt object. Like adapter objects, they are completely opaque and have no externally visible fields.

Figure 4.6. The interrupt object.
graphics/04fig06.gif

Table 4.10. Access Functions for an Interrupt Object
Interrupt Object Access Functions
Function Description Called by...
HalGetInterruptVector Converts bus-relative interrupt vector to systemwide value DriverEntry
IoConnectInterrupt Associates Interrupt Service routine with an interrupt vector DriverEntry or AddDevice
KeSynchronizeExecution Synchronizes driver routines that run at different IRQLs (Various)
IoDisconnectInterrupt Removes interrupt object Unload or RemoveDevice

Manipulating Interrupt Objects

Several system components export functions that work with interrupt objects. Table 4.10 lists the most common ones.

< BACK  NEXT >


The Windows 2000 Device Driver Book(c) A Guide for Programmers
The Windows 2000 Device Driver Book: A Guide for Programmers (2nd Edition)
ISBN: 0130204315
EAN: 2147483647
Year: 2000
Pages: 156

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net