Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
SysSegments


NAME

SysSegments - registration of reserved memory areas

SYNOPSIS

TYPE Address = LONGINT;
TYPE Size = LONGINT;
TYPE Mode = SHORTINT; (* <0: growing backward; =0 fixed; >0 growing forward *)
TYPE Segment =
   RECORD
      addr: Address;
      size: Size;
      mode: Mode;
   END;


PROCEDURE Register(addr: Address; size: Size; mode: Mode); PROCEDURE NumberOfSegments() : INTEGER; PROCEDURE GetSegment(segmentIndex: INTEGER; VAR segment: Segment);

DESCRIPTION

SysSegments allows the registration of reserved memory segments during the runtime startup which are not free for storage allocation. Later, these segments may be examined by the storage allocator.

A segment is given by the interval [addr, addr+size) and the growing mode which is specified by mode. Usually, there should be only one growing segment: the stack segment which is provided by the invocation environment.

Register is to be called only by the runtime start and registers the given segment.

NumberOfSegments returns the number of registered segments and GetSegment allows to retrieve the segments. Valid segment indexes range from 0 to NumberOfSegments()-1.

The current runtime start declares following segments:

0
program text and static data
1
preallocated area for Storage
2
stack of main coroutine
3
non-accessible area at end of address space

SEE ALSO

Storage
compiler interface of the storage allocator

Edited by: borchert, last change: 1993/06/10, revision: 1.1, converted to HTML: 1997/04/28

Oberon || Library || Module Index || Search Engine || Definition || Module