Specifications

System Macros Invoked by Drivers
IOFORK
IOFORK
Disables timeouts from a target device and creates a fork process for the context
of the code to execute that follows this macro invocation.
Format
IOFORK
Description
The IOFORK macro calls EXE$IOFORK to disable timeouts from a target device
(by clearing UCB$V_TIM in UCB$L_STS) and to create a fork process for a
device driver.
When the IOFORK macro is invoked, the following registers must contain the
values listed:
Register Contents
R3 Contents to be placed in R3 of the fork process
R4 Contents to be placed in R4 of the fork process
R5 Address of a UCB that will be used as a fork block for the fork
process to be created
00(SP) Address of callers caller
Example
WFIKPCH XA_TIME_OUT,IRP$L_MEDIA(R3) ;Wait for interrupt
IOFORK ;Device has interrupted; fork
The start-I/O routine of a driver initiates an I/O request by invoking the
WFIKPCH macro. The WFIKPCH macro sets UCB$V_INT and UCB$V_TIM
in UCB$L_STS to record an expected interrupt and enable timeouts from the
device, saving the PC of the instruction following IOFORK at UCB$L_FPC in
the drivers fork block. When the device interrupts, the driver’s interrupt service
routine clears UCB$V_INT and issues the instruction JSB @UCB$L_FPC(R5),
transferring control to the IOFORK macro invocation.
The IOFORK macro clears the UCB$V_TIM bit, creates a fork block, inserts it in
the appropriate fork queue, requests a software interrupt at that fork IPL from
the local processor, and returns control to the drivers interrupt service routine at
the instruction following the JSB. When the processor’s IPL drops below the fork
level, the fork dispatcher dequeues the fork block, obtains proper synchronization,
and resumes execution at the instruction in the driver that follows the IOFORK
invocation.
2–43