Specifications

Device Driver Entry Points
Start-I/O Routine
UCB$L_SVAPTE For a direct-I/O transfer, virtual address of first
page-table entry (PTE) of I/O-transfer buffer; for
buffered-I/O transfer, address of buffer in system
address space
Exit
The start-I/O routine suspends itself whenever it must wait for a required
resource, such as a controller data channel or UNIBUS or Q22–bus map registers.
To do so, it invokes a system macro (such as REQPCHAN or REQMPR) that saves
its context in the UCB fork block, places the UCB in a resource wait queue, and
returns control to the caller of the start-I/O routine.
The start-I/O routine also suspends itself when it issues a WFIKPCH or
WFIRLCH macro to initiate device activity. These macros also store the drivers
context in the UCB fork block to be restored when the device interrupts or times
out.
The start-I/O routine is again suspended if it forks to complete servicing of a
device interrupt. The IOFORK macro places driver context in the UCB fork
block, inserts the fork block into a processor-specific fork queue, and requests a
software interrupt from the processor at the corresponding fork IPL. After issuing
the IOFORK macro, the routine issues an RSB instruction, returning control to
the driver’s interrupt service routine.
The routine completes the processing of an I/O request by invoking the REQCOM
macro. In addition to initiating device-independent postprocessing of the current
request, the REQCOM macro also attempts to start the next request waiting for
a device unit. If there are no waiting requests, the macro returns control to the
caller of the start-I/O routine. This is often the system fork dispatcher.
Description
A drivers start-I/O routine activates a device and waits for a device interrupt or
timeout. After a device interrupt, the drivers interrupt service routine returns
control to the start-I/O routine at device IPL, holding the associated device lock
in a multiprocessing environment.
The start-I/O routine usually forks at this time to perform various device-
dependent postprocessing tasks, and returns control to the interrupt service
routine.
4–18