Specifications

7
Writing an Interrupt Service Routine
When a device generates a hardware interrupt, it requests an interrupt at the
appropriate device interrupt priority level (IPL). Either the device or its adapter
requests a processor interrupt at that IPL. When the processor executes at an
IPL below that device IPL, interrupt dispatching begins.
The mechanism of interrupt dispatching has no direct bearing on the contents of
a drivers interrupt service routine. Its implementation varies according to the
AXP system and I/O subsystem in use.
For most device drivers, the driver prologue table (DPT) contains, in the
reinitialization section established by the DPT_STORE_ISR macro, the address
of one or more interrupt service routines. Each interrupt service routine
corresponds to an interrupt vector on the I/O bus. You specify the interrupt
vector using the SYSMAN command IO_CONNECT.
Most device interrupt service routines perform the following functions:
Locate the device’s unit control block (UCB)
Determine whether the interrupt was solicited
Reject or process unsolicited interrupts
Activate the suspended driver to process solicited interrupts
The remaining sections of this chapter describe the handling of solicited and
unsolicited interrupts in further detail.
7.1 Servicing a Solicited Interrupt
When a drivers fork process activates a device and expects to service a device
interrupt as a result, the fork process suspends its execution and waits for an
interrupt to occur. The suspended driver is represented only by the contents of
the fork block in the device’s UCB and the stack, which contain the following
information:
A description of the I/O request and the state of the device
The contents of R3 and R4
The implicit contents of R5 (the address of the UCB fork block)
The address at which to return control to the driver
The implicit address of a timeout handling routine
When the interrupt service routine returns control to the main line of driver
processing, it has only restored the contents of R3, R4, R5, and the PC.
7–1