VMSideDoor.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Levin on September 20, 1983 11:58 am
Birrell, July 8, 1983 2:01 pm
Russ Atkinson (RRA) January 30, 1985 9:53:01 pm PST
Doug Wyatt, February 27, 1985 8:55:50 am PST
DIRECTORY
PrincOps USING [FrameSizeIndex, StateVector],
VM USING [Interval, PageCount];
VMSideDoor: DEFINITIONS
= BEGIN
Memory Sizes
vmPages: VM.PageCount;
Beware: this can change during initialization!
rmPages: INT;
"Snapshot the Frame Heap"
MarkerType: TYPE = MACHINE DEPENDENT {frame(0), deadSpace(1)};
FrameMarker: TYPE = MACHINE DEPENDENT RECORD [
marker(0): SELECT markerType(0:0..0): MarkerType FROM
frame => [fsi(0:1..15): PrincOps.FrameSizeIndex],
deadSpace => [count(0:1..15): NAT], -- count does NOT include FrameMarker
ENDCASE
];
FramesDescriptor: TYPE = LONG DESCRIPTOR FOR ARRAY OF WORD;
The array consists of a sequence of frames, each preceded by a FrameMarker.
StateVectorDescriptor: TYPE = LONG DESCRIPTOR FOR ARRAY OF PrincOps.StateVector;
GetFrames: PROC RETURNS [frames: FramesDescriptor, stateVectors: StateVectorDescriptor];
Each time this procedure is called it makes a consistent snapshot of the state of the local frames and state vectors and returns two descriptors for these snapshots. The contents of the memory referenced by these descriptors remains valid until the next call of the procedure. The "frames" area may contain local frames, (alloced) global frames, and long argument/return records.
Special Real Memory interface
These procedures are used to access the special real memory available on some machines (e.g., Dandelion).
AssignSpecialRealMemory: SAFE PROC [interval: VM.Interval];
The specified interval has its present contents (if any) moved to special real memory. The special real memory is then assigned to the interval and pinned. It is illegal to invoke VM.Pin or VM.Unpin on this memory; it can only be released by calling ReleaseSpecialRealMemory, below. The contents of the interval appear unchanged to the client.
ReleaseSpecialRealMemory: SAFE PROC [interval: VM.Interval];
The entire interval is expected to have special real memory. Its contents are copied to virtual memory and the real memory is reclaimed (i.e., available for re-allocation through AssignSpecialRealMemory). Every page of the interval will have a pinCount of zero, but will otherwise have the identical page state that obtained before the call of ReleaseSpecialRealMemory.
END.