Specifications
Allocating Map Registers and Other Counted Resources
3.2 Allocating Counted Resource Items
110$: CMPL #SS$_INSFMAPREG,R0 ; INSFMAPREG means request queued
BNEQ 120$ ; Other status means error; branch
MOVL #_C_MAP_ALLOC_WAIT_STATE,- ; Record wait state in
CDRP$L_WAIT_STATE(R5) ; CDRP
MOVL #SS$_INSFMAP,R0 ; Return status to caller of this
; driver routine
RSB
120$: ; Process returned errors (other than SS$_INSFMAPREG)
The OpenVMS AXP operating system 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 employs 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 (EOT) 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.)
IOC$ALLOC_CNT_RES never stalls a high-priority counted resource request
or places its CRCTX in a resource-wait queue. Rather, it attempts to allocate
the requested number of resource items immediately. If IOC$ALLOC_CNT_RES
cannot grant the requested number of items, it returns SS$_INSFMAPREG
status to its caller.
See OpenVMS AXP Device Support: Reference for a detailed description of
IOC$ALLOC_CNT_RES.
3.3 Loading Map Registers
A driver calls IOC$LOAD_MAP to load a set of adapter-specific map registers.
The driver must have previously allocated the map registers (including an extra
two to serve as guard pages) in calls to IOC$ALLOC_CRCTX and IOC$ALLOC_
CNT_RES.
IOC$LOAD_MAP requires the following as input:
• the address of the ADP of the adapter that provides the map registers
• the address of the CRCTX that describes the map register allocation
• the system virtual address of the page table entry (PTE) for the first page to
be used in the DMA transfer
• the Byte offset into the first page of the transfer
IOC$LOAD_MAP returns to a specified location a port-specific address of a DMA
buffer. The following example illustrates a call to IOC$LOAD_MAP:
100$: PUSHAL UCB$L_ARG(R4) ; Cell for returned DMA address
MOVZWL BD$W_PAGE_OFFSET(R3),-(SP) ; Pass starting buffer offset
PUSHL BD$L_SVAPTE(R3) ; Pass SVAPTE as argument
PUSHL R2 ; Pass CRCTX as argument
PUSHL PDT$L_ADP(R4) ; Pass ADP as argument
CALLS #5,IOC$LOAD_MAP ; Load the allocated map registers
See OpenVMS AXP Device Support: Reference for a detailed description of
IOC$LOAD_MAP.
3–5










