HwVidInterrupt Functionality

On entry, a HwVidInterrupt function should determine if its adapter actually generated an interrupt. The HwVidInterrupt function must return FALSE as soon as possible if it is called for a spurious interrupt. Then, the ISR for the device that generated the interrupt can be called quickly.

Otherwise, a miniport's HwVidInterrupt function is generally responsible for completing the I/O operation that caused the interrupt. Depending on the adapter and the design of the miniport, a HwVidInterrupt function does the following:

·Dismisses the interrupt on the adapter (required)

·Possibly, completes the requested operation that caused the interrupt

·Returns control as quickly as possible (required)

HwVidInterrupt cannot call certain VideoPortXxx without causing a system check condition. However, a HwVidInterrupt routine can call the following functions safely:

·VideoPortReadXxx and VideoPortWriteXxx

·VideoPortZeroDeviceMemory and VideoPortZeroMemory

·VideoPortLogError

·VideoPortStallExecution (for no more than a very few microseconds)

·VideoPortDisableInterrupt and VideoPortEnableInterrupt

A HwVidInterrupt routine cannot be pageable, nor can any function or routine that it calls.

Note that the HwVidInterrupt function can access the miniport's device extension. Depending on the design of the miniport, it might be impossible for other driver functions to share the device extension or a particular area of the device extension with the HwVidInterrupt function safely in SMP machines.

For example, suppose the miniport's HwVidStartIO function is accessing the device extension when the adapter interrupts, the HwVidInterrupt function is run on another processor, and the HwVidInterrupt function also accesses the device extension. If such a situation might occur, the miniport's HwVidStartIO function should call VideoPortSynchronizeExecution with a driver-supplied HwVidSynchronizeExecutionCallback function.

Any mapped access ranges that a HwVidInterrupt routine uses cannot be accessed by the corresponding display driver because display driver and miniport driver functions cannot be synchronized.