-- Store>SimpleSpace.mesa (last edited by Knutsen on August 27, 1980 1:06 PM)
-- This interface supplies I/O operations for those not in a postion to use the facilities of the VMMgr.
-- Note that if Map/Unmap are invoked from a process that holds the LogicalVolume monitor lock, the required File Descriptors and Page Group Descriptors must be pinned in the FileCache (since the File Helper is locked out).
DIRECTORY
CachedSpace USING [Handle, SizeSwapUnit],
ResidentMemory USING [Location],
Space USING [Handle, PageCount, PageNumber, WindowOrigin],
Utilities USING [LongPointerFromPage];
SimpleSpace: DEFINITIONS
IMPORTS Utilities =
BEGIN
Handle: TYPE = Space.Handle;
SizeSwapUnit: TYPE = CachedSpace.SizeSwapUnit;
WindowOrigin: TYPE = Space.WindowOrigin;
--~~~~~~ Operations usable only during Pilot initialization: ~~~~~~
Location: TYPE = ResidentMemory.Location;
AllocateVM: PROCEDURE [count: Space.PageCount, location: Location] RETURNS [page: Space.PageNumber];
-- Allocates VM only. You must do a StoragePrograms.DescribeSpace[...] yourself.
Create: PROCEDURE [count: Space.PageCount, location: Location, sizeSwapUnit: SizeSwapUnit ← noSwapUnits]
RETURNS [handle: Space.Handle];
-- Creates a simpleSpace.
noSwapUnits: SizeSwapUnit = 0;
DisableInitialization: PROCEDURE;
-- Must be executed after the last simple space has been created but before the contents of the Swapper space and region caches are copied up into the VMMgr databases.
--~~~~~~ Operations usable at all times: ~~~~~~
CopyIn: PROCEDURE [handle: Space.Handle, window: Space.WindowOrigin, countMapped: Space.PageCount ← defaultCount];
CopyOut: PROCEDURE [handle: Space.Handle, window: Space.WindowOrigin, countMapped: Space.PageCount ← defaultCount];
-- Analogous to Space.CopyIn / CopyOut, except: window.file must exist, must not be immutable (unless window.file lacks write permission), and must not end before countMapped, which if defaulted means the size of the simple space.
ForceOut: PROCEDURE [Space.Handle];
-- Analogous to Space.ForceOut. This is a no-op if the space is pinned.
Kill: PROCEDURE [Space.Handle];
-- Analogous to Space.Kill.
LongPointer: PROCEDURE [handle: Space.Handle] RETURNS [LONG POINTER] = INLINE
{ RETURN[ Utilities.LongPointerFromPage[ LOOPHOLE[handle, CachedSpace.Handle].page ] ] };
-- Returns pointer to starting page number of argument simple space.
Map: PROCEDURE [handle: Space.Handle, window: Space.WindowOrigin, andPin: BOOLEAN,
countMapped: Space.PageCount ← defaultCount];
-- Analogous to Space.Map, except: window.file must exist, must not be immutable (unless window.file lacks write permission), and must not end before countMapped, which if defaulted means the size of the simple space.
-- If window=defaultWindow, then we allocate real memory and pin it (no backing file); in this case, andPin and countMapped are ignored.
defaultCount: Space.PageCount = LAST[Space.PageCount];
Page: PROCEDURE [handle: Space.Handle] RETURNS [page: Space.PageNumber] = INLINE
{ RETURN[ LOOPHOLE[handle, CachedSpace.Handle].page ] };
-- Returns starting page number of argument simple space.
Unmap: PROCEDURE [Space.Handle];
-- Analogous to Space.Unmap.
END.
LOG
June 19, 1978 5:50 PMMcJonesCreated file.
August 7, 1978 11:44 PMPurcellAdded DisableCreate, parameters type to Create and andPin to Map.
August 10, 1978 3:56 PMPurcellMoved generalized create to VFSPrograms.DescribeSpace.
August 29, 1978 1:17 PMMcJonesAdded ForceOut.
March 5, 1979 9:48 AMMcJonesChanged definition of handle.
August 15, 1979 9:17 AMMcJonesAdded countMapped to Map.
August 21, 1979 10:18 AMKnutsenAdded comment to Map (not recompiled).
April 11, 1980 12:17 PMKnutsenAdded AllocateVM. Location gotten from ResidentMemory. Added swap unit parameter to Create.
August 26, 1980 10:16 AMKnutsenAdded Kill, LongPointer, CopyIn, CopyOut.