Guardian Procedure Calls Reference Manual
this area can be the TNS data stack, the main stack, an unprivileged selectable extended
data segment, or any of the code areas mapped into KUSEG.
◦ For CALLABLE procedures running on the TNS data stack, no part of the reference
parameter can be within an area that starts at the base of the CALLABLE procedure's
stack and extends to 0 locations beyond the L register of the CALLABLE procedure. This
is true only for procedures that run on a TNS processor and are not running on the
TOSSSTACK, or for TAL procedures running on a native processor.
◦ For CALLABLE procedures with parameters within a valid code area, the parameter
address is valid only if the CALLABLE procedure is making a read-only reference.
• If the address area is in bounds in an extensible segment and disk space for the extensible
segment needs to be allocated, REFPARAM_BOUNDSCHECK_ allocates more space for the
segment. If no space is available, REFPARAM_BOUNDSCHECK_ returns error 3.
• To exclude address references from the stack area used by the calling procedure, use DEFINES
with the framestart parameter as follows:
1. Invoke the _FRAME_EDGE_DEF DEFINE among the declarations in the procedure.
2. Pass the names of the first and last parameters of the procedure to the _FRAME_EDGE_DEF
DEFINE. If the procedure has no parameters, invoke _FRAME_EDGE_DEF (‘L' - 2).
3. Pass _FRAME_EDGE as the framestart parameter to REFPARAM_BOUNDSCHECK_.
• In a multithreaded process that uses multiple stack areas, checking is performed only for the
thread that calls REFPARAM_BOUNDSCHECK_.
• The 64-bit address range includes sign-extended 32-bit addresses as a proper subset.
• A caller can protect its own stack frame (treat it as out-of-bounds) by passing as framestart
the last + 1 address of the parameter area. This address is available via the intrinsic function
_paramstart() ($PARAMSTART in pTAL).
• framestart is ignored unless the caller is running on a registered user stack; frame protection
is not available on thread stacks allocated from a segment or heap.
• An absolute address in the context of this procedure is an address that is either in the TNS
System Data Segment (address range 0x20000 through 0x3FFFF) or in the 32-bit global
address range (0xFFFFFFFF80000000 through 0xFFFFFFFFFFFFFFFF) and not in an area
allotted to libraries or other user-visible segments.
Example
INT PROC TSTBND ( alpha,omega);
INT .EXT alpha;
FIXED omega;
BEGIN
_FRAME_EDGE_DEF ( alpha,omega );
IF REFPARAM_BOUNDSCHECK_(alpha,2D,_FRAME_EDGE,0) THEN
RETURN -1;
RETURN 0;
END;
REFPARAM_BOUNDSCHECK[64]_ Procedures 1233