Specifications

Device Driver Entry Points
Timeout Handling Routine
Timeout Handling Routine
Takes whatever action is necessary when a device has not yet responded to a
request for device activity and the time allowed for a response has expired.
Specified in
Specify the address of the timeout handling routine in the excpt argument to the
WFIKPCH or the WFIRLCH macro.
Called by
The WFIKPCH and WFIRLCH macros use this entry point, but only when the
name of a timeout handling routine is provided in their excpt argument. These
macros are used in the drivers start-I/O routine; thus, strictly speaking, the
driver itself is the only entity that uses this entry point.
Routines in the system module TIMESCHDL call the timeout handling routine at
the request of the WFIKPCH and WFIRLCH macros.
Synchronization
A timeout handling routine is called at device IPL and must return to its caller at
device IPL. In a multiprocessing environment, the processor holds both the fork
lock and device lock associated with the device at the time of the call.
After taking whatever device-specific action is necessary at device IPL, a timeout
handling routine can lower IPL to fork IPL to perform less critical activities.
Because its caller restores IPL to fork IPL (and releases the device lock in a
multiprocessing environment), if a timeout handling routine does lower IPL, it
can do so only by forking or by performing the following steps:
Issue a DEVICEUNLOCK macro to lower to fork level
Perform timeout handling activities possible at the lower IPL
Issue a DEVICELOCK macro to again obtain the device lock and raise to
device IPL
Issue an RSB instruction to return to its caller
Context
Because a timeout handling routine executes in the context of a fork process, it
can access only those virtual addresses that refer to system (S0) space.
Register usage
A timeout handling routine can use R0, R1, and R2 freely, but must preserve the
contents of all other registers. If a timeout handling routine uses the stack, it
must restore the stack before completing or canceling the current I/O request,
waiting for an interrupt, or returning control to its caller.
4–19