-- VMMgr>SpaceImplInternal.mesa (February 17, 1981 by Knutsen)
-- This is the interface between SpaceImplA and SpaceImplB.
DIRECTORY
CachedRegion USING [Desc, Operation],
CachedSpace USING [Desc, Handle, Level],
Space USING [PageCount, PageNumber],
VM USING [Interval];
SpaceImplInternal: DEFINITIONS =
BEGIN
-- Commonly Used TYPEs:
Interval: TYPE = VM.Interval;
Level: TYPE = CachedSpace.Level;
SpaceD: TYPE = CachedSpace.Desc;
RegionD: TYPE = CachedRegion.Desc;
-- Shared Data:
spaceLock: MONITORLOCK; -- this protects all VMMgr data and databases.
-- Monitor EXTERNAL Procedures:
InitializeSpaceImplB: --EXTERNAL-- PROCEDURE [sizeVM: Space.PageCount];
-- Monitor ENTRY Procedure:
EnterSpace: --"ENTRY"-- PROCEDURE [internalProc: PROCEDURE [] ];
-- Enters the Space monitor and calls internalProc. internalProc may freely signal or not catch signals from below (but should catch UNWIND from here if appropriate).
-- All client processes which wish to enter the Space Monitor MUST enter via this procedure.
-- Monitor INTERNAL Procedures:
ApplyToInterval: --INTERNAL-- PROCEDURE [interval: Interval, operation: CachedRegion.Operation];
-- Performs, in ascending order, operation (successfully) for each swap unit of each region of interval (exactly as required by CachedRegion.Apply).
-- May raise NotePinned (only if operation.action=unmap).
-- for operation=writeProtect, flush, remap, and unmap, interval must start and end on a region boundary! (restriction of CachedRegion.Apply)
NotePinned: SIGNAL [levelMax: Level, page: Space.PageNumber];
-- The interval being operated on (being unmapped) contains a pinned space. The space contains page and is pinned at some level <= levelMax. The operation was done on the current region. The catcher of the signal should make the Hierarchy reflect the fact that this space(s) are no longer pinned, then RESUME the signal.
ApplyToSpace: --INTERNAL-- PROCEDURE [handle: CachedSpace.Handle, operation: CachedRegion.Operation]
RETURNS [validHandle: BOOLEAN];
-- Validates handle, then ApplyToInterval[space.interval, operation].
ForAllRegions: --INTERNAL-- PROCEDURE [interval: Interval, Predicate: RegionPredicate] RETURNS [trueOfAll: BOOLEAN];
-- Returns TRUE iff predicate is TRUE for every region of interval.
RegionPredicate: TYPE = PROCEDURE [region: RegionD] RETURNS [trueOfRegion: BOOLEAN];
UnmapInternal: --INTERNAL-- PROCEDURE [pSpaceD: POINTER TO SpaceD];
-- Unmaps the space. Caller must have done error checking previously.
END.
LOG
June 19, 1980 2:34 PMGobbelCreated file.
August 4, 1980 1:45 PMKnutsenAdded NotePinned. Deleted unused items. Commented the procedures.
January 27, 1981 1:35 PMKnutsenAdded EnterSpace.
January 30, 1981 11:11 AMKnutsenUnmapInternal’s arg can not be ReadOnly.
February 17, 1981 9:52 PMKnutsenPass arg to InitializeSpaceImplB.