Cedar Remote Debugging: processes - PrincOps-level interface
AMProcessBasic.mesa
Andrew Birrell August 1, 1983 12:09 pm
DIRECTORY
PrincOps USING[ ControlLink, Frame, FrameHandle, GlobalFrameHandle, Priority, PsbIndex, PsbNull ],
WorldVM USING[ World ];
AMProcessBasic: DEFINITIONS =
BEGIN
This interface is primarily private, for use by AMProcessImpl. The "ReturnLink" procedure is for use by the AMTypes implementation. Others should consult a wizard before venturing in here.
State:
TYPE = {
ready, -- on the ready list (but not waitingSV or waitingCV)
waitingSV, -- ready (but not waitingCV), but no state vector available
waitingCV, -- "waiting" flag in PSB: indicates process is on some CV queue
waitingML, -- "enterFailed" flag in PSB and not ready, not faulted: waiting to enter a monitor
frameFault, pageFault, writeProtectFault, unknownFault, -- on a fault queue
dead, -- not a currently valid process
unknown, -- not dead, not waitngCV, not waitingML, not on ready list, not on a fault queue
uncaughtSignal, breakpoint, callDebugger -- these states aren't generated by this interface
};
Faulted: TYPE = State[frameFault..unknownFault];
GFTable: TYPE = REF GFTableObject; -- NIL => all modules
GFTableObject:
TYPE =
RECORD[
count: CARDINAL, -- amount of the sequence actually used; "length" is allocated length
frames: SEQUENCE length: CARDINAL OF PrincOps.GlobalFrameHandle
];
Info:
PROC[world: WorldVM.World,
psbi: PrincOps.PsbIndex,
freeze, thaw: BOOL,
fullStatus: BOOL,
filter: GFTable,
wantedStates: PACKED ARRAY State OF BOOL]
RETURNS[
state: State,
faultData: LONG CARDINAL,
priority: PrincOps.Priority,
frame: PrincOps.FrameHandle,
frozenFrame: PrincOps.FrameHandle,
topFrame: PrincOps.FrameHandle];
Thaw: PROC[world: WorldVM.World, psbi: PrincOps.PsbIndex];
Abort: PROC[world: WorldVM.World, psbi: PrincOps.PsbIndex];
ReturnLink:
PROC[world: WorldVM.World, frame: PrincOps.FrameHandle,
psbi: PrincOps.PsbIndex ← PrincOps.PsbNull]
RETURNS[link: PrincOps.ControlLink];
Returns the link that would exist if there were no frozen processes. Assumes frame is valid. This is primarily for use by "DynamicParent" in AMTypes. If frame.returnlink is frozen, determines "real" link by looking in "freezees" array. If psbi = PrincOps.PsbNull, determines psbi by enumerating all frozen processes (slowly).
END.