Specifications
Operating System Routines
IOC$ALOTCMAP_DMA, IOC$ALOTCMAP_DMAN
Synchronization
The caller of IOC$ALOTCMAP_DMA or IOC$ALOTCMAP_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 at the caller’s IPL. The caller retains any spinlocks it held at
the time of the call.
Description
IOC$ALOTCMAP_DMA and IOC$ALOTCMAP_DMAN allocate a contiguous
set of TURBOchannel DMA map registers. IOC$ALOTCMAP_DMA records the
allocation in the ADP and CRB while IOC$ALOTCMAP_DMAN records the same
information in a map register descriptor. Figure 3–1 shows the structure of the
map register descriptor used by IOC$ALOTCMAP_DMAN.
Figure 3–1 TURBOchannel Map Register Descriptor (TC_MD)
ZK−4629A
TC_MD$W_NUMREG TC_MD$W_MAPREG
31 0
TC_MD$W_MAPREG contains the number of the first (starting) map register and
TC_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$ALOTCMAP_DMA calculates the number of map registers required
using the values contained in UCB$W_BCNT and UCB$W_BOFF.
• IOC$ALOTCMAP_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$ALOTCMAP_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$ALOTCMAP_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–74