Specifications
Operating System Routines
IOC$ALLOCATE_CRAM
IOC$ALLOCATE_CRAM
Allocates a control register access mailbox (CRAM).
Module
[SYSLOA]CRAM_ROUTINES_LSB
Input
Location Contents
04(SP) Reserved for returned address of CRAM
Output
Location Contents
04(SP) Address of CRAM
R0 Status of operation
Synchronization
During normal processing, IOC$ALLOCATE_CRAM uses no spinlocks. However,
if there are no free CRAMs available, the routine acquires and releases the
MMG spinlock while allocating additional CRAMs from nonpaged memory. Thus,
the caller should be running at or below IPL$_MMG. If the caller is running
above IPL$_MMG, no attempt is made to allocate additional CRAMs, and
IOC$ALLOCATE_CRAM returns an error status.
Description
IOC$ALLOCATE_CRAM first checks to see if memory has already been allocated
for use as mailboxes. If memory has been allocated, the routine checks to see if a
CRAM is available. If no CRAMs have been configured or none are available, the
routine allocates four pages of system nonpaged memory and divides this memory
into one CRAM header (CRAMH) and 15 CRAMs.
When an available CRAM is found, the routine marks it as unavailable and
returns its address to the caller.
3–70