Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (S)
Guardian Procedure Calls Reference Manual—522629-013
14-13
SEGMENT_ALLOCATE_ Procedure
1 Allocate an extensible segment; sharing by the PIN method can be
specified.
2 Allocate a segment with sharing by the file name method.
3 Allocate an extensible segment with sharing by the file name method.
4, 6Allocate a read-only segment; sharing by either the PIN method or the file
name method can be specified.
base-address input,output
EXTADDR .EXT:ref:1
if used as an output parameter, returns the base address of the segment being
allocated. The
base-address parameter can be used to determine whether the
segment allocated is a flat segment or a selectable segment. The base address of
a segment also can be obtained by calling the SEGMENT_GETINFO_ procedure.
•
For a flat segment, the base-address output parameter value is different for
each allocated segment. A flat segment is requested by setting bit 14 of the
alloc-options parameter to 1.
•
For a selectable segment, the base-address output parameter value is
always %2000000D (%H00080000%D).
If
base-address is used as an input parameter, it specifies the base address of
the flat segment being allocated. This parameter is not updated on output. Bits 14
and 15 of the
alloc-options parameter must be 1; otherwise, the value in the
base-address parameter is ignored.
A program should usually allow the SEGMENT_ALLOCATE_ procedure to
designate the address where a flat segment should start. In particular, library
procedures that allocate flat segments should not specify a base address, because
this allocation may be incompatible with other library-allocated or user-allocated
segments within the same process. This feature can be useful for process pairs.
For example, the primary process uses the
base-address parameter as an
output parameter and supplies the address to its backup process. The backup
process, in turn, uses the
base-address parameter as an input parameter to
allocate the segment in the same place.
•
For a flat segment, use the base-address input parameter only if it is
necessary to force segment allocation to begin at a specific address. For
existing systems that support flat segments, the specified address must be a
multiple of 32 kilobytes at or above %H30000000. Avoid hard-coding the
address, because the valid range of addresses can change from RVU to RVU.
An error is returned if the address is out of range, if the address is not a
multiple of 32 kilobytes, or if the allocated segment would overlap a previously
allocated segment.
•
For a shared flat segment, the base-address input parameter maps the
shared segment starting at the base specified address. If
base-address is
omitted, SEGMENT_ALLOCATE_ attempts to map the segment at the same
base address as in the process that first allocated the segment. If that process
no longer shares the segment, the default address is taken from one of the