MBVM.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Sandman on 16-Feb-81 15:37:15
Lewis on 17-Sep-81 11:50:14
Levin on January 12, 1984 4:49 pm
Russ Atkinson (RRA) March 8, 1985 4:57:21 pm PST
DIRECTORY
BasicLoadStateFormat USING [ConfigIndex, nullConfig],
BcdDefs USING [SPHandle],
BootStartList USING [SwapUnitIndex, SwapUnitInfo],
FS USING [OpenFile],
PrincOps USING [ControlLink],
Rope USING [ROPE];
MBVM: CEDAR DEFINITIONS =
BEGIN
ROPE: TYPE = Rope.ROPE;
Base: TYPE = CARDINAL; -- VM page number
Pages: TYPE = CARDINAL;
FileBase: TYPE = CARDINAL; -- file page number
DefaultBase: Base = Base.LAST;
Code: Base = Base.LAST - 1;
First64K: Base = Base.LAST - 2;
MDS: Base = Base.LAST - 3;
HyperSpace: Base = Base.LAST - 4;
MaxBase: Base = Base.LAST - 5; -- largest usable VM page number
Seg: TYPE = REF Object; -- describes some pages in the target world
DataSeg: TYPE = REF data Object;
CodeSeg: TYPE = REF code Object;
FileSeg: TYPE = REF file Object;
File: TYPE = ROPE; -- describes a file in MakeBoot's address space
Segment: TYPE = REF SegmentObject; -- describes some file pages in MakeBoot's world
SegmentObject: TYPE = RECORD [
file: File ← NIL,
base: FileBase ← 0,
pages: Pages ← 0
];
BIndex: TYPE = BasicLoadStateFormat.ConfigIndex;
nullIndex: BIndex = BasicLoadStateFormat.nullConfig;
Object: TYPE = RECORD [
base: Base,
pages: Pages,
index: BootStartList.SwapUnitIndex,
info: BootStartList.SwapUnitInfo ← [readOnly: TRUE, state: $swappable],
bootLoaded: BOOLFALSE,
file: File ← NIL, -- not meaningful for data Object
fileBase: FileBase ← 0, -- not meaningful for data Object
body: SELECT objType: ObjectType FROM
data => [],
code => [
sph: BcdDefs.SPHandle,
shared: BOOLFALSE,
pieces: CodePieceList ← NIL
],
file => [
bIndex: BIndex,
nUnits: CARDINAL ← 1
],
ENDCASE
];
ObjectType: TYPE = {data, code, file};
CodePieceList: TYPE = LIST OF CodePiece;
CodePiece: TYPE = RECORD [
offset: CARDINAL, -- (word) displacement of start of piece
body: SELECT kind: * FROM
code => [length: CARDINAL], -- in words
link => [links: Links],
ENDCASE
];
Links: TYPE = REF LinksObject;
LinksObject: TYPE = RECORD[SEQUENCE length: NAT OF PrincOps.ControlLink];
Segs: TYPE = REF SegsSequence;
SegsSequence: TYPE = RECORD[SEQUENCE length: NAT OF Seg];
From MBVMemory
Direction: TYPE = {up, down};
AllocData: PROC [base: Base, pages: Pages, dir: Direction ← $down] RETURNS [DataSeg];
AllocMDSData: PROC [base: Base, pages: Pages, dir: Direction ← $down] RETURNS [DataSeg];
AllocCode: PROC [
file: File, base: Base, pages: Pages, fileBase: FileBase, sph: BcdDefs.SPHandle]
RETURNS [CodeSeg];
AllocFile: PROC [file: File, base: Base, pages: Pages, fileBase: FileBase]
RETURNS [FileSeg];
BackingForSeg: PROC [seg: Seg] RETURNS [file: FS.OpenFile, fileBase: FileBase];
SortSegs: PROC RETURNS [Segs];
PointerFromSeg: PROC [s: Seg] RETURNS [p: POINTER];
LongPointerFromSeg: PROC [s: Seg] RETURNS [p: LONG POINTER];
SegFromPointer: PROC [p: POINTER] RETURNS [s: Seg];
SegFromLongPointer: PROC [p: LONG POINTER] RETURNS [s: Seg];
From MBCache
GetPage: PROC [page: Base] RETURNS [p: LONG POINTER];
MDS-relative reads and writes
Read: PROC [p: POINTER] RETURNS [v: UNSPECIFIED];
Write: PROC [p: POINTER, v: UNSPECIFIED];
CopyRead: PROC [from, to: POINTER, nwords: CARDINAL];
CopyWrite: PROC [from, to: POINTER, nwords: CARDINAL];
VM-relative reads and writes
LongRead: PROC [p: LONG POINTER] RETURNS [v: UNSPECIFIED];
LongWrite: PROC [p: LONG POINTER, v: UNSPECIFIED];
LongCopyRead: PROC [from: LONG POINTER, to: LONG POINTER, nwords: CARDINAL];
LongCopyWrite: PROC [from: LONG POINTER, to: LONG POINTER, nwords: CARDINAL];
END.