## Physical Device Driver Reference

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

### Interrupt Level Sharing

A hardware interrupt level that is shared by two or more devices is referred to as a shared interrupt. Interrupt sharing is an extension of a device's design. A single interrupt level (IRQ) can be shared by two or more devices if the devices are specifically built for interrupt sharing. With cooperation from its device, a physical device driver can share only the hardware interrupt level. This is true for both edge-triggered and level-sensitive interrupt environments.

In an edge-triggered interrupt environment, an interrupt request is recognized by the 8259 Programmable Interrupt Controller (PIC) as a particular edge transition (such as low-to-high) on the hardware interrupt request line. The interrupt request line can remain level without generating another interrupt. The 8259 PIC requires an End-Of-Interrupt ( EOI) and another of the same kind of edge transition to recognize an interrupt on that interrupt level.

In a level-sensitive interrupt environment, an interrupt request is recognized by the 8259 PIC as a particular level on the hardware interrupt request line. The interrupt condition must be removed before the EOI is issued, or else the 8259 continues to generate interrupts for that interrupt level.

Note: OS/2 supports interrupt sharing on the IBM PS/2* and the EISA machines, which provide a level-sensitive interrupt environment where multiple device drivers can share a particular hardware interrupt.

The basic model for managing a hardware interrupt follows:

1.The physical device driver must register an interrupt handler for a hardware interrupt, specifying whether the physical device driver intends to share the interrupt level.

2.When started, the physical device driver interrupt handler tests the device to see if it generated the interrupt.

3.If the device has an interrupt pending or caused a spurious interrupt, the interrupt handler owns the processing of the interrupt. The handler services the device, resets the interrupting condition at the device, issues the End-Of-Interrupt (EOI) with the DevHlp_EOI, performs a far return (ret far) indicating that the interrupt handler owned the interrupt, and clears the carry flag (CF=0).

4.If the device does not have an interrupt pending, the interrupt handler does not own processing of the interrupt. The handler must perform a ret far indicating that it does not own the interrupt, and set the carry flag ( CF=1).