WVMPrivate.mesa - Internal WorldVM Interface
Copyright © 1985 by Xerox Corporation. All rights reserved.
Andrew Birrell December 2, 1983 1:14 pm
Russ Atkinson, February 6, 1985 9:13:06 pm PST
DIRECTORY
DiskFace USING[ Label, Type ],
BasicLoadStateFormat USING[ LoadStateObject ],
LoadState USING[ Handle ],
PrincOps USING [op, PageNumber, PageValue, wordsPerPage],
Rope USING[ ROPE ],
WorldVM USING [Address, Incarnation, World];
WVMPrivate: DEFINITIONS = BEGIN OPEN Rope;
Basic data types
pageSize: CARDINAL = PrincOps.wordsPerPage;
PageNumber: TYPE = PrincOps.PageNumber;
PageAddress: PROC[mempage: PageNumber] RETURNS[ WorldVM.Address ] = INLINE {
RETURN[ mempage * LONG[pageSize] ];
};
DiskAddress: TYPE = RECORD[
deviceType: DiskFace.Type,
deviceOrdinal: CARDINAL,
diskPage: LONG CARDINAL, -- device-relative page number of start of run
offset: CARDINAL, -- page number from start of run, for label checksum calculation
labelCheck: CARDINAL -- label checksum of start of run (Pilot relic: should use entire label)
];
onlyMDS: WorldVM.Address = --TEMP kludge-- 400000B;
WorldType: TYPE = { none, local, other, remote };
World: TYPE = REF WorldObject;
WorldObject: PUBLIC TYPE = RECORD[
name: ROPE,
incarnation: WorldVM.Incarnation ← FIRST[WorldVM.Incarnation],
lock: NAT ← 0,
state: { creating, created, bad } ← creating,
running: BOOLEANTRUE,
vmBackingMap: WVMPrivate.VMBackingMap ← NIL,
basicLoadState: REF BasicLoadStateFormat.LoadStateObject ← NIL,
loadState: LoadState.Handle ← NIL,
loadStateValid: BOOLFALSE,
mdsBase: WorldVM.Address ← onlyMDS,
foo: SELECT type: WorldType FROM
none => NULL,
local => NULL,
other => NULL,
remote => [host: WVMPrivate.Machine]
ENDCASE];
Map of debuggee's VM backing file
VMBackingMap: TYPE = REF VMBackingMapObject;
VMBackingMapObject: TYPE;
CreateVMBackingMap: PROC[world: WorldVM.World] RETURNS[ VMBackingMap ];
May read only swapped-in (or resident) client pages.
ReadVMBackingMap: PROC[world: WorldVM.World, log: VMBackingMap] RETURNS[basic, real: WorldVM.Address -- loadtstae addresses --];
GetVMBackingMapEntry: PROC[log: VMBackingMap, mempage: PageNumber] RETURNS[ DiskAddress ];
Page cache
PageHandle: TYPE = REF PageInfo;
PageInfo: TYPE;
PageData: TYPE = ARRAY [0..pageSize) OF CARDINAL;
GetPage: PROC[world: WorldVM.World, mempage: PageNumber] RETURNS[ data: REF PageData, handle: PageHandle ];
If "coreOnly" and page is not swapped in, returns [NIL,NIL].
ReleasePage: PROC[handle: PageHandle];
WriteAndReleasePage: PROC[handle: PageHandle];
Remote page transfers
MapEntry: TYPE = PrincOps.PageValue;
Machine: TYPE[3];
LocateRemote: PROC[ROPE] RETURNS[ Machine ];
GoRemote: PROC[host: Machine];
ReadRemoteCore: PROC [host: Machine, data: REF PageData, mempage: PageNumber] RETURNS [map: MapEntry, ok: BOOLEAN];
WriteRemoteCore: PROC [host: Machine, data: REF PageData, mempage: PageNumber, map: MapEntry] RETURNS [BOOL];
ReadRemoteDisk: PROC[host: Machine, data: REF PageData, addr: DiskAddress, label: LONG POINTER TO DiskFace.Label];
WriteRemoteDisk: PROC[host: Machine, data: REF PageData, addr: DiskAddress, label: LONG POINTER TO DiskFace.Label];
World-swap page transfers
LocateOther: PROC; -- outload, boot physical volume, return after inload --
GoOther: PROC; -- outload, return after inload --
ReadOtherCore: PROC[data: REF PageData, mempage: PageNumber] RETURNS[ok: BOOLEAN];
WriteOtherCore: PROC[data: REF PageData, mempage: PageNumber] RETURNS[BOOL];
ChannelDirection: TYPE = { read, write };
MoveLocalDiskPage: PROC[ data: REF PageData, direction: ChannelDirection, addr: DiskAddress];
Reading debuggee's loadstate
GetLoadState: PROC[world: World, basic, real: WorldVM.Address];
Patching primitive for AMProcessBasicImpl
Patch: PROC[world: WorldVM.World, addr: WorldVM.Address, offset: [0..1], byte: PrincOps.op] RETURNS[oldByte: PrincOps.op];
END.