User`s guide

Recommended and Required Source Changes
3.10 Locking Pages into a Working Set
Since all code to be locked anywhere in the image goes into the same psect, this
method of using psects has the side effect of locking all lockable code when any
requester locks any section. This is probably advantageous; OpenVMS Alpha or
OpenVMS I64 pages are at least 8KB and most requesters are locking a pagelet
or less, so most of the time all of the code to be locked will fit on a single page.
Note
If the code is being locked because the IPL will be raised above 2, where
page faults cannot occur, make sure that the delimited code does not call
run-time library routines or other procedures. The VAX MACRO compiler
generates calls to routines to emulate certain VAX instructions. An image
that uses these macros must link against the system base image so
that references to these routines are resolved by code in a nonpageable
executive image.
Image Initalization-Time Lockdown
For image initialization-time lockdown, three macros are used:
$LOCKED_PAGE_START
$LOCKED_PAGE_END
$LOCK_PAGE_INIT
The macros $LOCKED_PAGE_START and $LOCKED_PAGE_END mark the
beginning and end of a code segment which may be locked. The code delineated
by these macros must contain complete routines—execution cannot fall through
either macro, nor can the locked code be branched into or out of. Any attempt to
branch into or out of the locked code section, or to fall through the macros will be
flagged by the compiler with the following error message:
%AMAC-E-MULTLKSEC, Routines which share code must use the same linkage psect.
$LOCKED_PAGE_END has an optional parameter, LINK_SECT, which is used
to specify the linkage psect to return to after the routine is executed. It is only
used if the linkage psect in effect when the $LOCKED_PAGE_START macro was
executed was not the default linkage psect, $LINKAGE.
The macro $LOCK_PAGE_INIT must be executed in the initialization routines of
an image which is using $LOCKED_PAGE_START and $LOCKED_PAGE_END
to delineate areas to be locked. It creates the necessary psects and issues the
$LKWSET calls to lock the code and linkage sections into the working set. R0
and R1 are destroyed by this macro.
$LOCK_PAGE_INIT has an optional parameter, ERROR, which is an error
address to which to branch if one of the $LKWSET calls fail. If this address is
reached, R0 reflects the status of the failed call, and R1 contains 0 if the call to
lock the code failed, or 1 if that call succeeded but the call to lock the linkage
section failed.
Note that since psects are used to identify code to be locked, the $LOCK_PAGE_
INIT macro need not be in the same module as the code delineated by the
$LOCKED_PAGE_START and $LOCKED_PAGE_END macros. The invocation of
$LOCK_PAGE_INIT locks all delineated code in the entire image.
3–20 Recommended and Required Source Changes