Incremental Load State Locking.
Data is guaranteed to be persistent only while lock is held.
XRLockIncrementalLoadState:
PROCEDURE [wait: bool]
RETURNS [XRILError];
Try to acquire lock on load state.
The `wait' parameter says whether to block until it's available.
Waiting is abortable.
Result.ile𡤌ode may be ETIMEDOUT or XRORTED.
A successful call must be followed (eventually) by a call to UnlockIncrementalLoadState.
XRUnlockIncrementalLoadState:
PROCEDURE []
RETURNS [XRILError];
Release lock on load state.
Result.ile𡤌ode may be EINVAL if lock is not held.
Incremental Load File record.
XRILFileEntry:
TYPE ~
POINTER
TO XRILFileEntryRep;
nullXRILFileEntry: XRILFileEntry ~ NIL;
XRILFileEntryRep:
TYPE ~
RECORD [
ilfeseqNum: unsigned,
ilfecommitPoint: bool,
file info
ilfefName: charStar,
ilfefOffset: unsigned,
ilfefMagic: unsigned,
ilfefSize: sizet,
ilfefMTime: timet,
version stamp (supplied by installation proc)
ilfevMagic: unsigned,
ilfevLen: unsigned,
ilfevStamp: charStar,
file type specific data (optionally supplied by reader proc)
ilferdrData: caddrt,
ilferdrDataBytes: unsigned,
patch, text, data, bss, and common segments
ilfepAddr: caddrt,
ilfepBytes: unsigned,
ilfetAddr: caddrt,
ilfetBytes: unsigned,
ilfedAddr: caddrt,
ilfedBytes: unsigned,
ilfebAddr: caddrt,
ilfebBytes: unsigned,
ilfecAddr: caddrt,
ilfecBytes: unsigned
];
XRILGetPrevFileEntry:
PROCEDURE [ilfe: XRILFileEntry]
RETURNS [XRILFileEntry];
Return ILFileEntries in reverse order of loading.
Return most-recently-loaded entry if ilfe is NIL.
Return NIL at end of sequence.
To be called by an installation proc to record its version stamp.
The vStamp pointer is stored into the XR←ILFileEntry associated with pc, without being copied; thus, it can't point to a buffer in a local frame.
BEWARE: these procs don't do any locking. Concurrent calls that add version stamps for different files don't interfere with one another.
XRILAddVersionStamp:
PROCEDURE [
ilfe: XRILFileEntry, vMagic: unsigned, vLen: unsigned, vStamp: caddrt]
RETURNS [];
XRILAddVersionStampUsingPC:
PROCEDURE [
pc: caddrt, vMagic: unsigned, vLen: unsigned, vStamp: charStar]
RETURNS [XRILFileEntry];
Load state symbol lookup
PCR retains all external or text symbols.
All these symbols are accessible by name.
Only relocatable (not absolute) symbols are accessible by value.
XRILLookupSymEntry:
PROCEDURE [sym: charStar, externOnly: bool]
RETURNS [XRILSymEntry];
Return XR←ILSymEntry for (most recent instance of) sym.
Note sym may be undefined (in symbol table because it has been referenced but not yet defined).
Return NIL if no instance of sym exists in load state.
If externOnly is true, symbols that aren't extern are ignored.
XRILLookupSymEntryByValue:
PROCEDURE [val: unsigned]
RETURNS [XRILSymEntry];
Return XR←ILSymEntry for most recently defined text, data or bss (but not absolute) symbol of maximum value not greater than val.
Note: symbol will not be undefined.
XRILGetPrevSymEntry:
PROCEDURE [ilse: XRILSymEntry, externOnly: bool]
RETURNS [XRILSymEntry];
Return XR←ILSymEntry for next most recent definition of symbol corresponding to ilse.
Return NIL if no more definitions.
If externOnly is true, symbols that aren't extern are ignored.
XRILGetPrevSymEntryByValue:
PROCEDURE [ilse: XRILSymEntry]
RETURNS [XRILSymEntry];
Return XR←ILSymEntry for prev symbol def by value.
Return NIL if no more definitions.
XRILGetNextSymEntryByValue:
PROCEDURE [ilse: XRILSymEntry]
RETURNS [XRILSymEntry];
Return XR←ILSymEntry for next symbol def by value.
Return NIL if no more definitions.
}.