Specifications

Operating System Routines
IOC$ALOALTMAP, IOC$ALOALTMAPN, IOC$ALOALTMAPSP
Synchronization
Callers of IOC$ALOALTMAP, IOC$ALOALTMAPN, or IOC$ALOALTMAPSP may
be executing at fork IPL or above and must hold the corresponding fork lock in
a multiprocessing environment. Each 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$ALOALTMAP, IOC$ALOALTMAPN, and IOC$ALOALTMAPSP allocate a
contiguous set of Q22–bus alternate map registers (registers 496 to 8191) and
record the allocation in the ADP and CRB. These routines differ in the way in
which they determine the number and location of the alternate map registers
they allocate:
IOC$ALOALTMAP calculates the number of needed map registers using the
values contained in UCB$W_BCNT and UCB$W_BOFF. It automatically
allocates one extra map register. When it is later called by the driver,
IOC$LOADALTMAP marks this register invalid to prevent a transfer
overrun.
IOC$ALOALTMAPN uses the value in R3 as the number of required
registers.
IOC$ALOALTMAPSP uses the value in R3 as the number of required
registers and attempts to allocate these registers starting at the one indicated
by R4.
If an odd number of map registers is required, these routines round this value up
to an even multiple.
If alternate map registers have been permanently allocated to the controller,
IOC$ALOALTMAP, IOC$ALOALTMAPN, or IOC$ALOALTMAPSP returns
successfully to its caller without allocating the requested map registers.
Otherwise, it searches the alternate map register descriptor arrays for the
required number of map registers. If there are not enough contiguous map
registers available, the routine returns SS$_INSFMAPREG status.
If the system does not support alternate map registers, the routine exits with
SS$_SSFAIL status.
Device drivers generally obtain Q22–bus alternate map registers by calling
IOC$REQALTMA which calls IOC$ALOALTMAP to do the actual allocating.
If registers are not available, IOC$REQALTMA places the process on the map
register wait queue and does not return to the caller until sufficient registers
have been allocated.
3–72