-- VMMgr>STLeaf.mesa (last edited by Knutsen on July 31, 1980 10:50 AM)
-- This interface defines types for the Heirarchy and Projection B-trees, and routines for creating, etc., leaves of the B-trees.
-- Note that the elements of a projection desc are a subset of the elements of a CachedRegion.Desc.
DIRECTORY
CachedRegion USING [State],
CachedSpace USING [Desc, Level],
Environment USING [Word, wordsPerPage],
VM USING [PageNumber];
STLeaf: DEFINITIONS =
BEGIN
ILeaf: TYPE = RECORD [CARDINAL]; -- index of a Leaf
PLeaf: TYPE = LONG POINTER TO Leaf; -- pointer to a Leaf
sizeLeaf: CARDINAL = Environment.wordsPerPage;
Leaf: TYPE = RECORD [SELECT OVERLAID * FROM
sTree => [
cDesc: CDesc, -- descriptors in use
descFirst: Desc ], -- first of array of bound Desc’s
free => [iLeafNext: ILeaf], -- next free page
fill => [ARRAY [0..sizeLeaf) OF RECORD [Environment.Word]], -- occupies a page
ENDCASE ];
sizeLeafBody: CARDINAL = SIZE[Leaf] - SIZE[CDesc];
CDesc: TYPE = CARDINAL; -- count of Descriptors
Kind: TYPE = {hierarchy, projection};
Desc: TYPE = RECORD [SELECT OVERLAID Kind FROM
hierarchy =>
[descH: CachedSpace.Desc],
projection => -- the elements of projection desc are a subset of the elements of CachedRegion.Desc.
[page: VM.PageNumber, -- key
level: CachedSpace.Level,
levelMapped: CachedSpace.Level,
hasSwapUnits: BOOLEAN,
state: ProjectionState,
writeProtected: BOOLEAN,
needsLogging: BOOLEAN ],
ENDCASE ];
alive: CachedRegion.State = CachedRegion.State[outAlive]; -- in the Projection, we only know that the region is some unknown flavor of alive (out, in, pinned).
ProjectionState: TYPE = CachedRegion.State[CachedRegion.State[unmapped]..alive];
Create: PROCEDURE RETURNS [ILeaf];
Delete: PROCEDURE [ILeaf];
Open: PROCEDURE [ILeaf] RETURNS [PLeaf];
Close: PROCEDURE [ILeaf];
END.
LOG
Time: May 16, 1978 11:21 AMBy: McJonesAction: Created file
Time: June 24, 1978 5:38 PMBy: McJonesAction: PageNumber moved to VM
Time: August 4, 1978 2:14 PMBy: McJonesAction: Added beingRemapped to projection Desc
Time: September 26, 1979 1:53 PMBy: KnutsenAction: Added hasSwapUnits, writeProtected to, deleted beingRemapped from projection Desc. Added alive.
Time: July 7, 1980 4:10 PMBy: GobbelAction: Added needsToBeLogged to projection Desc.
Time: July 31, 1980 10:50 AMBy: KnutsenAction: Made compatible with new CachedRegion.Desc.