Cedar Remote Debugging: Internal WorldVM Interface
WVMPrivate.mesa
Andrew Birrell December 2, 1983 1:14 pm
DIRECTORY
DiskFace USING[ Label, Type ],
BasicLoadStateFormat USING[ LoadStateObject ],
LoadState USING[ Handle ],
PrincOps USING [op, PageNumber, wordsPerPage],
Rope USING[ ROPE ],
WorldVM USING [Address, Incarnation, World];
WVMPrivate: DEFINITIONS =
BEGIN
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.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 = MACHINE DEPENDENT RECORD [
flags: RECORD[logSE, W, D, R: BOOLEAN],
page: [0..7777B]];
Machine: TYPE[3];
LocateRemote: PROC[Rope.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.