<> <> <> <> DIRECTORY BcdOps USING [SPHandle], PilotLoadStateFormat USING [ConfigIndex, NullConfig], Segments USING [FHandle, SHandle], StartList USING [SwapUnitIndex, SwapUnitInfo]; MBVM: DEFINITIONS = BEGIN DefaultFile: Segments.FHandle = NIL; Base: TYPE = CARDINAL; -- VM page number Pages: TYPE = CARDINAL; DefaultBase: Base = LAST[Base]; Code: Base = LAST[Base]-1; First64K: Base = LAST[Base]-2; MDS: Base = LAST[Base]-3; HyperSpace: Base = LAST[Base]-4; MaxBase: Base = LAST[Base]-5; -- largest usable VM page number Seg: TYPE = LONG POINTER TO Object; DataSeg: TYPE = LONG POINTER TO data Object; CodeSeg: TYPE = LONG POINTER TO code Object; FileSeg: TYPE = LONG POINTER TO file Object; BIndex: TYPE = PilotLoadStateFormat.ConfigIndex; nullIndex: BIndex = PilotLoadStateFormat.NullConfig; Object: TYPE = RECORD [ link: Seg, seal: [0..1777B] _ ObjectSeal, bootLoaded: BOOLEAN _ FALSE, index: StartList.SwapUnitIndex, info: StartList.SwapUnitInfo _ [readOnly: TRUE, state: swappable], base: Base, pages: Pages, body: SELECT objType: ObjectType FROM data => [], code => [ file: Segments.FHandle, fileBase: CARDINAL, segment: Segments.SHandle, sph: BcdOps.SPHandle, shared: BOOLEAN _ FALSE ], file => [ file: Segments.FHandle, fileBase: CARDINAL, segment: Segments.SHandle, bIndex: BIndex, nUnits: CARDINAL _ 1 ], ENDCASE ]; ObjectType: TYPE = {data, code, file}; ObjectSeal: [0..1777B] = 1235B; <> Direction: TYPE = {up, down}; AllocData: PROC [base: Base, pages: Pages, dir: Direction _ down] RETURNS [s: DataSeg]; AllocMDSData: PROC [base: Base, pages: Pages, dir: Direction _ down] RETURNS [s: DataSeg]; AllocCode: PROC [ file: Segments.FHandle, base: Base, pages: Pages, fileBase: CARDINAL, sph: BcdOps.SPHandle] RETURNS [s: CodeSeg]; AllocFile: PROC [file: Segments.FHandle, base: Base, pages: Pages, fileBase: CARDINAL] RETURNS [s: FileSeg]; SortSegs: PROC RETURNS [LONG DESCRIPTOR FOR ARRAY OF Seg]; ReleaseCodeSegs: PROC; 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]; <> GetPage: PROC [page: Base] RETURNS [p: LONG POINTER]; <> 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]; <> 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.