Specifications

Operating System Routines
IOC$ALOVMEMAP_DMA, IOC$ALOVMEMAP_DMAN
Synchronization
The caller of IOC$ALOVMEMAP_DMA or IOC$ALOVMEMAP_DMAN must
be executing at fork IPL or above and must hold the corresponding fork lock
(typically IOLOCK8) in a multiprocessing environment. Either routine returns
control to its caller and the caller’s IPL. The caller retains any spinlocks it held
at the time of the call.
Description
IOC$ALOVMEMAP_DMA and IOC$ALOVMEMAP_DMAN allocate a contiguous
set of VME DMA map registers. IOC$ALOVMEMAP_DMA records the allocation
in the ADP and CRB while IOC$ALOVMEMAP_DMAN records the same
information in a map register descriptor. Figure 3–2 shows the structure of the
map register descriptor used by IOC$ALOVMEMAP_DMAN.
Figure 3–2 VME Map Register Descriptor (VME_MD)
31 0
VME_MD$W_NUMREG VME_MD$W_MAPREG
ZK3732AGE
VME_MD$W_MAPREG contains the number of the first (starting) map register
and VME_MD$W_NUMREG contains the number of map registers allocated.
These routines differ in the way in which they determine the number of map
registers they allocate:
IOC$ALOVMEMAP_DMA calculates the number of needed map registers
using the values contained in UCB$W_BCNT and UCB$W_BOFF.
IOC$ALOVMEMAP_DMAN uses the value in R3 as the number of required
registers.
If there are not enough contiguous map registers available, the routine returns
an error status of SS$_INSFMAPREG to its caller.
Because the map registers eventually must be released, the caller of
IOC$ALOVMEMAP_DMAN must keep track of the map registers allocated.
Care should be exercised in the consumption and management of map register
resources.
When using the IOC$ALOVMEMAP_DMA routine, note that if there are not
enough map registers available, your driver can put a fork block onto the map
register allocation wait queue in the ADP (ADP$L_MRQFL). When registers are
released, the release routine checks for waiting fork threads. If any threads are
waiting, the routine attempts to complete the allocation at that time.
3–78