Specifications

Allocating Map Registers and Other Counted Resources
3.3 Loading Map Registers
Having loaded the map registers for a DMA transfer, a driver typically performs
some of the following steps to initiate the transfer:
Loads the port-specific DMA address into a device DMA address register.
Some manipulation of the address value might be needed, depending upon
the hardware. (For instance, a DEC 3000 AXP Model 500 driver must clear
the two low bits before writing to the register.)
Computes the transfer length and loads a device transfer count register.
Typically a driver derives the transfer length from a field such as UCB$L_
BCNT.
Sets to GO byte in the device CSR (possibly indicating the direction of the
transfer as well) by writing a mask to the CSR.
3.4 Deallocating a Number of Counted Resources
A driver calls IOC$DEALLOC_CNT_RES to deallocate a requested number of
items of a counted resource. IOC$DEALLOC_CNT_RES requires the addresses
of both the CRAB and CRCTX as input. After deallocating the items, if there are
any stalled requests, IOC$DEALLOC_CNT_RES queues a fork thread that will
attempt to allocate the resource to the stalled requests.
The following example illustrates a call to IOC$DEALLOC_CNT_RES:
PUSHL R2 ; Push CRCTX as argument
PUSHL ADP$L_CRAB(R4) ; Push CRAB as argument
CALLS #2,IOC$DEALLOC_CNT_RES ; Deallocate the map registers
See OpenVMS AXP Device Support: Reference for a detailed description of
IOC$DEALLOC_CNT_RES.
3.5 Deallocating a Counted Resource Context Block
A driver calls IOC$DEALLOC_CRCTX to deallocate a CRCTX. IOC$DEALLOC_
CRCTX requires only the address of the CRCTX as input.
A driver must not deallocate a CRCTX that describes a request that has been
stalled waiting for sufficient resource items to be made available (that is, a
CRCTX that is in a given CRAB wait queue). Prior to deallocating such a
CRCTX, a driver should call IOC$CANCEL_CNT_RES to cancel the resource
request.
The following example illustrates a call to IOC$DEALLOC_CRCTX:
PUSHL R2 ; Pass CRCTX as argument
CALLS #1,IOC$DEALLOC_CRCTX ; Deallocate the CRCTX
See OpenVMS AXP Device Support: Reference for a detailed description of
IOC$DEALLOC_CRCTX.
3–6