Guardian Application Conversion Guide

Converting Memory-Management Procedure Calls
Converting Other Parts of an Application
096047 Tandem Computers Incorporated 8–37
Converting
Memory-Management
Procedure Calls
The D-series operating system provides new memory-management procedures to
allocate, make accessible, deallocate, and get information about extended data
segments. It also provides a new procedure for checking the address limits of either
your process’s data segment or an extended data segment. These new procedures are
described in the following subsections.
Note Converting an application to use the D-series memory-management procedures is necessary only if the
application shares an extended data segment with a high-PIN process using the PIN method. Converting
to use the SEGMENT_USE_ and ADDRESS_DELIMIT_ procedures is optional at this time but will be
required under future versions of the operating system.
Allocating an Extended
Data Segment
Your existing program might call the ALLOCATESEGMENT procedure to allocate an
extended data segment:
error := ALLOCATESEGMENT (segment^id,
segment^size,
swap^file^name);
Convert your program to call the SEGMENT_ALLOCATE_ procedure. If you specify
a swap file, use a variable-length string file name rather than the 12-word internal file
name. Specify the length in bytes of the swap file name as a separate integer
parameter.
In the following example, SEGMENT_ALLOCATE_ allows the calling process to share
the extended data segment identified by
segment^id
using the PIN method. The
system returns the base address of the segment in
base^address
:
error := SEGMENT_ALLOCATE_(segment^id,
segment^size,
! swap^file^name:length ! ,
error^detail,
! pin ! ,
! segment^type ! ,
@base^address);
To allocate an extended data segment for a backup process, call the
SEGMENT_ALLOCATE_CHKPT_ procedure from the primary process. This
procedure supersedes the CHECKALLOCATESEGMENT procedure.
Making an Extended Data
Segment Accessible
Your existing program that calls the ALLOCATESEGMENT procedure probably calls
the USESEGMENT procedure to make the segment current and therefore accessible to
your application:
old^segment^id := USESEGMENT (segment^id);
You can optionally convert your program to call the SEGMENT_USE_ procedure. In
this example, the ID of the extended segment that was accessible before this call to
SEGMENT_USE_ is returned in the output parameter
old^segment^id
. If no
extended segment was accessible before this call, -1 is returned.