## Physical Device Driver Reference

[prev][next][parent][TOC]

### Interrupt After START

For a staged ABIOS request that must wait for the interrupt associated with the specified LID to occur after the request is started, the return code of the request is set to stage-on-interrupt by the ABIOS START function. This indicates that the request is incomplete. Several requests for this LID can start and can be waiting for the device interrupt. These incomplete requests are commonly referred to as outstanding requests for the LID.

Note: The request is considered to be an outstanding request for the LID even if the Start service has not returned control to the caller of the Start service.

A physical device driver does not assume that the return codes for an ABIOS request occur in any given order. The return code should always be checked to determine what actions to perform on the request block.

When the device driver interrupt handler is invoked by the device interrupt , it knows which LID is associated with the interrupt level. The interrupt handler must individually examine each LID associated with the interrupt level. For a LID, the interrupt handler must process all outstanding staged-on interrupt request blocks. That is, the interrupt handler is required by ABIOS to call the Advanced BIOS interrupt routine for every outstanding staged-on interrupt request block to completely process one LID . This includes a START request block in which the return code has been changed from FFFFH to stage-on interrupt, but the Start service has not yet returned control to its caller. If one of the request blocks for the LID caused the interrupt after the interrupt handler has called ABIOS with all the outstanding request blocks owned by this LID, the interrupt handler does not need to process any other LID associated with this interrupt level .

Advanced BIOS requires that physical device drivers adhere to the following rules for sharing interrupt levels:

ABIOS REQUEST BLOCK RULE

The interrupt handler for a particular LID, when invoked by the operating system, must call Advanced BIOS for each ABIOS request block that is stage- on-interrupt, even if one of the request blocks gets the return indicator that the interrupt belongs to it.

ABIOS EOI PLACEMENT RULE

The EOI must be issued after all ABIOS staged-on interrupt request blocks have been processed for the LID that owns the interrupt.

ABIOS LID IRQ RULE

Advanced BIOS defines only one interrupt level for each LID. If a physical device driver handles more than one LID on the same interrupt level, the physical device driver could choose to register only one interrupt handler for any LID on that level. In this case, the operating system calls the handler only once when the interrupt occurs. The handler must manage the processing of more than one LID in order to determine if it owns the interrupt processing for them. In this case, the device driver interrupt handler should be aware of the Fairness Criteria problem. A LID at the end of the interrupt handler's list does not get as much service as a very active LID at the front of the list.

If a given LID has no outstanding ABIOS request blocks, the physical device driver calls the Advanced BIOS Default Interrupt service for that LID. The Default Interrupt service resets the interrupt condition for that LID if the LID falsely caused the interrupt. It then returns to the device driver interrupt handler, indicating that the interrupt belonged to the LID.

If there is at least one outstanding ABIOS request block for a given LID, ABIOS automatically invokes the Default Interrupt service if the LID generates a false interrupt. The physical device driver must be able to process the false interrupt return code for any call to the ABIOS interrupt routine. This return code indicates that the interrupt belonged to the LID , was reset by ABIOS. The physical device driver is responsible for issuing the EOI and returning to the operating system as owning the interrupt.

The device driver interrupt handler can issue the EOI (through the DevHlp EOI function) only after completely processing the LID that owns the interrupt or after the LID's Default Interrupt service indicates that the LID's device caused the interrupt. The interrupt handler must process all outstanding requests under the LID that owns the interrupt, even after finding a request block that indicates that it caused the interrupt. The interrupt handler can stop processing any LID for this interrupt only when the interrupt is claimed by a LID, either by a request under the owning LID or by the owning LID's Default Interrupt service. Once the interrupt handler issues the EOI after completely processing a LID, another LID requesting service at the current interrupt level would create another interrupt. Once the EOI is issued, the interrupt handler can be re-entered at its entry point. If the interrupt handler is reentered, it must process every LID, including the one that is near completion or just completed.

In order to keep the pre-EOI processing time to a minimum, the interrupt handler should issue its EOI before it sets the return information in the operating system request packet or before it begins processing a request packet queued by the device driver strategy routine.

If the interrupt handler did not find any LID that claimed the given interrupt with a request block or by a Default Interrupt service, the interrupt handler must exit, indicating that the interrupt did not belong to it (that is, the interrupt was not caused by any LID that is owned by the physical device driver).

Eventually, the return code from ABIOS will show that the ABIOS request block is complete. The physical device driver can then clear the device driver request packet queue, take the next request packet, and try to start another ABIOS request block.

The physical device driver supports the timeout requirements of ABIOS with the DevHlp_SetTimer and the DevHlp_TickCount. Instead of counting every clock tick, the device driver uses TickCount to force its timer tick entry point to receive control as infrequently as possible. The design of the ABIOS TIMEOUT function is in one-second increments.