Specifications

Operating System Routines
LDR$ALLOC_PT
LDR$ALLOC_PT
Allocates the specified number of system page-table entries (SPTEs).
Module
PTALLOC
Input
Location Contents
R2 Number of SPTEs to be allocated
LDR$GL_SPTBASE Base of system page table
LDR$GL_FREE_PT Offset to first free SPTE
Output
Location Contents
R0 SS$_NORMAL, SS$_INSFSPTS, or SS$_
BADPARAM
R1 Address of first allocated SPTE
R2 Number of allocated system page-table entries
Synchronization
Because LDR$ALLOC_PT executes at IPL$_SYNCH and obtains the MMG
spinlock in a multiprocessing environment, its caller cannot be executing above
IPL$_SYNCH or hold any higher ranked spinlocks. (For instance, a driver fork
process executing at IPL$_SYNCH holding the IOLOCK8 fork lock can call
LDR$ALLOC_PT.) LDR$ALLOC_PT returns control to its caller at the callers
IPL. The caller retains any spinlocks it held at the time of the call.
Description
LDR$ALLOC_PT allocates the number of system page-table entries (SPTEs)
specified in R2. LDR$ALLOC_PT adjusts the pool of free SPTEs to reflect the
allocation of the SPTEs.
A generic VAXBI device driver calls LDR$ALLOC_PT if it must map the device’s
node window space. It is the callers responsibility to fill in each allocated SPTE
with a page-frame number (PFN), set its valid bit, and otherwise initialize it.
If R2 contains a zero, LDR$ALLOC_PT returns SS$_BADPARAM status in R0
and clears R1. If there are no free SPTEs, it returns SS$_INSFSPTS status to its
caller.
3–146