Specifications

OpenVMS System Routines Called by OpenVMS AXP Device Drivers
IOC$ALLOC_CNT_RES
The number of the first resource item granted to the caller is placed in
CRCTX$L_ITEM_NUM and CRCTX$V_ITEM_VALID is set in CRCTX$L_
FLAGS.
If this allocation attempt fails, saves the current values of R3, R4, and R5 in
the CRCTX fork block. IOC$ALLOC_CNT_RES writes a –1 to CRCTX$L_
ITEM_NUM, and inserts the CRCTX in the resource-wait queue (headed by
CRAB$L_WQFL). It then returns SS$_INSFMAPREG status to its caller.
Note
If a counted resource request does not specify a callback routine
(CRCTX$L_CALLBACK), IOC$ALLOC_CNT_RES does not insert
its CRCTX in the resource-wait queue. Rather, it returns SS$_
INSFMAPREG status to its caller.
When a counted resource deallocation occurs, the CRCTX is removed from the
wait queue and the allocation is attempted again.
When the allocation succeeds, IOC$ALLOC_CNT_RES issues a JSB
instruction to the callback routine (CRCTX$L_CALLBACK), passing it
the following values:
Location Contents
R0 SS$_NORMAL
R1 Address of CRAB
R2 Address of CRCTX
R3 Contents of R3 at the time of the original
allocation request (CRCTX$Q_FR3)
R4 Contents of R4 at the time of the original
allocation request (CTCTX$Q_FR4)
R5 Contents of R5 at the time of the original
allocation request (CRCTX$Q_FR5)
Other registers Destroyed
The callback routine checks R0 to determine whether it has been called with
SS$_NORMAL or SS$_CANCEL status (from IOC$CANCEL_CNT_RES). If
the former, it typically proceeds to loads the map registers that have been
allocated.
It releases the spin lock indicated by CRAB$L_SPINLOCK.
OpenVMS AXP allows you to indicate that a counted resource request should
take precedence over any waiting request by setting the CRCTX$V_HIGH_PRIO
bit in CRCTX$L_FLAGS. A driver uses a high-priority counted resource request
to preempt normal I/O activity and service some exception condition from the
device. (For instance, during a multivolume backup, a tape driver might make
a high-priority request, when it encounters the end-of-tape marker, to get a
subsequent tape loaded before normal I/O activity to the tape can resume. A disk
driver might issue a high-priority request to service a disk offline condition.)
A–4