Data Types for Process machinery (wizards only)
Queue: TYPE = LONG POINTER TO QueueRep;
QueueRep:
TYPE =
RECORD [busy: Process, chain: Process];
MetaQueue: TYPE = LONG POINTER TO Process;
MetaQueueRep:
TYPE = Process;
MonitorLock: TYPE = LONG POINTER TO MonitorLockRep;
MonitorLockRep:
TYPE =
RECORD [queue: QueueRep, owner: Process];
Condition: TYPE = LONG POINTER TO ConditionRep;
ConditionRep:
TYPE =
RECORD [queue: QueueRep, timeout: Word];
InterruptCondition: TYPE = LONG POINTER TO InterruptConditionRep;
InterruptConditionRep:
TYPE =
RECORD [queue: QueueRep, timeout: Word, requests: Word];
ProcessPtr: TYPE = LONG POINTER TO Process;
Process: TYPE = LONG POINTER TO ProcessRep;
ProcessRep:
TYPE =
RECORD [
queue: Queue, -- pointer to queue that this process is waiting for
next: Process, -- next process in above circular queue
meta: Process, -- next process in ready queue, timeout queue or page fault queue
when: Word, -- when timeout will occur OR page number for fault
priority: Priority, -- priority of this process
state: ProcessState, -- process state
euState: EUstate -- useful registers in EU
];
Priority:
TYPE =
MACHINE
DEPENDENT {
slothful (0), -- user-level deep background processing (idle)
sluggish (1), -- user-level background processing
normal (2), -- user-level normal processing
perky (3), -- user-level foreground processing
nervous (4), -- system-level ?? processing
jumpy (5), -- system-level ?? processing
excited (6), -- system-level real-time processing
hyper (7) -- system-level emergency processing
};
ProcessState:
TYPE =
MACHINE
DEPENDENT {
free (0), -- process is on free list
running (1), -- process is running (assigned to a processor)
ready (2), -- process is ready to run (on ready queue)
waitingPage (3), -- process is waiting for page fault (on page fault queue)
waitingQueue (4), -- process is waiting for Notify (on condition queue)
stopped (5), -- process is stopped (on stopped queue)
done (6) -- process is done (waiting for Join)
};
EUstateIndex:
TYPE =
MACHINE
DEPENDENT {
MDF (0), -- shifter control
Hook (1), -- pointer to the youngest frame saved to memory
FramesLeft (2), -- frames left before fault occurs
FloatingMode (3) -- floating point mode register
};
EUstate: TYPE = ARRAY EUstateIndex OF Word;
Processor: TYPE = LONG POINTER TO ProcessorRep;
ProcessorRep:
TYPE =
RECORD [
next: Processor, -- next processor in ring
orders: ProcessorOrders, -- orders for what to do after reschedule
switchTo: Process, -- if orders = switchToGiven, then this is the one to switch to
running: Process -- the process currently being run
];
ProcessorOrders:
TYPE =
MACHINE
DEPENDENT {
reset (0), -- useful during system init (?)
noChange (1), -- ignore the reschedule
switchToGiven (2), -- switch to process given by processor.switchTo (NIL => to best)
panicStop (3) -- save current process, then spin on these orders
};
RequestKind: TYPE = [0..31];
RequestWordPtr: TYPE = LONG POINTER TO RequestWord;
RequestWord:
TYPE =
PACKED
ARRAY RequestKind
OF
BOOL;
NullRequestWord: RequestWord = LOOPHOLE[LONG[0]];