WVMPrivate.mesa
Cedar Remote Debugging: Internal WorldVM Interface
Andrew Birrell December 2, 1983 1:14 pm
Russ Atkinson, April 25, 1984 8:35:27 pm PST
DIRECTORY
DiskFace USING[ Label, Type ],
BasicLoadStateFormat USING[ LoadStateObject ],
BootFileChanges USING [PageValue],
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 = BootFileChanges.PageValue;
RRA: This was changed to allow 64K pages of real memory
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.