Specifications

System Macros Invoked by Drivers
TIMEWAIT
TIMEWAIT
Waits for a specified bit to be cleared or set within a specified length of time.
Format
TIMEWAIT time ,bitval ,source ,context [,sense=.TRUE.]
Parameters
time
Number of 10-microsecond intervals to wait. The operating system multiplies this
value by a processor-specific value in order to calculate the interval to wait. The
processor-specific value is inversely proportional to the speed of the processor, but
is never less than 1.
bitval
Mask that determines which bits to test.
source
Address of bits to test.
context
Context in which the bits are to be tested (B, W, or L).
[sense=.TRUE.]
If .TRUE., test for one or more of the specified bits set; otherwise test for all bits
cleared.
Description
The TIMEWAIT macro checks for a specific state by testing bits for a specified
length of time.
If the state comes into existence during the specified interval, the TIMEWAIT
macro places a success code in R0 and returns control to its caller. If the state
does not occur during the specified period, the TIMEWAIT macro places a failure
code in R0 and returns control to its caller. The TIMEWAIT macro destroys the
contents of R1, and preserves the contents of all other registers.
Because the TIMEDWAIT macro provides more flexibility and a more controlled
environment for detection of events or conditions, Digital recommends its use
over the TIMEWAIT macro.
Example
MOVQ R0,-(SP) ;Save R0,R1
TIMEWAIT #3,#RL_CS_M_CRDY,-
RL_CS(R4),W
MOVQ (SP)+,R0 ;Restore R0,R1
DLDRIVER’s unit initialization routine uses the TIMEWAIT macro to wait 30
microseconds for the RL11 controller to be ready before proceeding.
2–100