Specifications
System Macros Invoked by Drivers
WFIKPCH, WFIRLCH
WFIKPCH, WFIRLCH
Suspends a driver fork thread and folds its context into a fork block in
anticipation of a device interrupt or timeout. When WFIKPCH is invoked, the
fork thread keeps ownership of the controller channel while waiting; when
WFIRLCH is invoked, the fork thread releases ownership of the controller
channel.
Format
WFIKPCH
WFIRLCH
excpt [,time=65536]
Parameters
excpt
Name of a device timeout handling routine; the address of this routine must be
within 65,536 bytes of the address at which the WFIKPCH macro is invoked.
[time=65536]
Timeout interval, expressed as the number of seconds to wait for an interrupt
before a device timeout is considered to exist. A value equal to or greater than 2
is required because the timeout detection mechanism is accurate only to within
one second.
Description
The WFIKPCH and WFIRLCH macros push time on the stack and call
IOC$WFIKPCH and IOC$WFIRLCH, respectively. After the JSB instruction
that makes the routine call, either of these macros constructs a word that
contains the relative offset to the timeout handling routine specified in excpt.
Because these routines compute and store the address of the following instruction
in the fork block at UCB$L_FPC, the software timer interrupt service routine can
determine the routine’s location and call it if the device times out before it can
deliver an interrupt.
IOC$WFIKPCH and IOC$WFIRLCH assume that, prior to the invocation of the
macro, a DEVICELOCK macro has been issued—both to synchronize with other
device activity and to leave the IPL of the previous code thread on the top of
the stack. Upon storing the context of and suspending the current code thread,
IOC$WFIKPCH and IOC$WFIRLCH return control to their caller’s caller at the
stored IPL.
When the WFIKPCH or WFIRLCH macro is invoked, the following locations must
contain the values listed:
Location Contents
R5 Address of UCB
00(SP) IPL at which control is passed to the caller’s caller
04(SP) Address (in the caller’s caller) at which to return control
2–108