User`s guide

Macros for Porting from VAX to Alpha or I64
$LOCK_PAGE
Description
This macro is placed inline in executable code and must be followed by the
$UNLOCK_PAGE macro. The $LOCK_PAGE/$UNLOCK_PAGE macro pair
creates a separate routine in a separate psect. $LOCK_PAGE locks the pages and
linkage section of this separate routine into the working set and JSRs to it. All
code between this macro and the matching $UNLOCK_PAGE macro is included
in the locked routine and is locked down.
All registers are preserved by this macro unless the error address parameter is
present and one of the calls fail. If that happens, R0 reflects the status of the
failed call. R1 then 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.
If the ERROR parameter is used, the ERROR label must be placed outside the
scope of the $LOCK_PAGE and $UNLOCK_PAGE pair. This is because the error
routine is branched to before calling the subroutine that the $LOCK_PAGE and
$UNLOCK_PAGE routines create.
Note that since the locked code is made into a separate routine, any references
to local stack storage within the routine will have to be changed, as the stack
context is no longer the same. Also, you cannot branch into or out of the locked
code from the rest of the routine.
$UNLOCK_PAGE
Marks the end of a section of code to be locked on-the-fly.
Format
$UNLOCK_PAGE [error][,LINK_SECT]
Parameters
[error]
An error address to which to branch if one of the $ULKWSET calls fail.
[link_sect]
Linkage psect to return to if the linkage psect in effect when the $LOCK_PAGE
macro was executed was not the default linkage psect, $LINKAGE.
Description
$UNLOCK_PAGE returns from the locked routine created by the $LOCK_PAGE
and $UNLOCK_PAGE macro pair and then unlocks the pages and linkage section
from the working set. This macro is placed inline in executable code after a
$LOCK_PAGE macro.
All registers are preserved by this macro unless the error address parameter is
present and one of the calls fail. If that happens, R0 reflects the status of the
failed call. R1 then contains 0 if the call to unlock the code failed or 1 if that call
succeeded but the call to unlock the linkage section failed.
D–10 Macros for Porting from VAX to Alpha or I64