A driver's DpcForIsr routine is responsible for determining a final status for the current request, completing the IRP, and starting the next one. Execution ContextIn response to the ISR's call to IoRequestDpc, a driver's DpcForIsr routine (described in Table 8.6) is added to the DPC dispatch queue. When the CPU's IRQL value drops below DISPATCH_LEVEL, the DPC dispatcher calls the DpcForIsr routine. A DpcForIsr routine runs at DISPATCH_LEVEL IRQL, which means it has no access to pagable addresses. The I/O Manager ignores multiple calls to IoRequestDpc for a given device until the DpcForIsr routine executes. This is normal behavior for all DPC objects. If a driver design is such that it might issue overlapping DPC requests for the same device, then the driver must perform custom queuing of the DPC requests. What the DpcForIsr Routine DoesSince most of the work happens during interrupt processing, the DpcForIsr routine in a programmed I/O driver doesn't have a lot to do. In particular, this routine should
Priority IncrementsThe Windows 2000 thread scheduler uses a priority boosting strategy to keep the CPU and I/O devices as busy as possible. As can be seen from the boost values listed in Table 8.7, priority increments are weighted in favor of threads working with interactive devices like the mouse and keyboard. As part of this strategy, a driver should compensate any thread that waits for an actual device operation by giving a priority boost. Choose an appropriate increment from the table and specify it as an argument to IoCompleteRequest.
|