InstallationSupportPrivate.mesa
Copyright Ó 1990, 1991 by Xerox Corporation. All rights reserved.
Chauser, May 3, 1990 1:18 pm PDT
Willie-s, August 9, 1991 12:51 pm PDT
DIRECTORY
CStrings,
MesaLoadState,
SafeStorage,
RefTab;
InstallationSupportPrivate: CEDAR DEFINITIONS
~ BEGIN
Type: TYPE ~ SafeStorage.Type;
LinkType: TYPE ~ {proc, var, signal, startTrap};
Key: TYPE ~ RECORD [
name: CString ¬ NIL,
type: Type
];
CString: TYPE ~ CStrings.CString;
The format of this record is constrained by the generated c2c code. In particular items[0] must be offset 4 words from the beginning of the interface record and each item must occupy exactly one word.
Interface: TYPE ~ REF InterfaceRecord;
InterfaceRecord: TYPE ~ MACHINE DEPENDENT RECORD [
key (0): Key,
aux(2): AuxInterface ¬ NIL,
items(3): SEQUENCE nItems(3): CARD OF LinkItem
];
LinkItem: TYPE ~ RECORD [
SELECT COMPUTED LinkType FROM
proc => [proc: PROC],
var => [var: POINTER],
signal => [var: POINTER],
startTrap => [trap: POINTER TO TrapDescriptor],
ENDCASE
];
AuxInterface: TYPE ~ REF AuxInterfaceRecord;
The auxiliary interface record is used for information that won't fit in the compiler-defined interface record; for example, it holds uncommitted exports, import requests, and the tag field for each LinkItem in the interface.
AuxInterfaceRecord: TYPE ~ RECORD [
prohibitDuplicateExports: BOOL ¬ FALSE,
unique: BOOL ¬ FALSE,
items: SEQUENCE nItems: CARD OF AuxItem
];
UncommittedProcExport: TYPE ~ RECORD[proc: PROC, unitsOut, unitsIn, argsIn: CARD, exporter: Program];
UncommittedVarExport: TYPE ~ RECORD[varPtr: POINTER, exporter: Program];
ImportDesired: TYPE ~ RECORD[unitsOut, unitsIn, argsIn: CARD, importer: Program];
AuxItem: TYPE ~ RECORD [
itemTag: { empty, unboundTrap, startTrap, bound },
uncommitted: SELECT auxTag: * FROM
none => [],
uncommittedProcExports => [ue: LIST OF UncommittedProcExport],
uncommittedVarExport => [uv: LIST OF UncommittedVarExport],
importDesired => [ui: LIST OF ImportDesired],
ENDCASE
];
Config: TYPE = REF ConfigRep;
ConfigRep: PUBLIC TYPE ~ RECORD [
parent: Config,
name: CString,
controlModule: ControlModule,
contents: ProgramAndConfigList,
opaque: BOOL, -- in an opaque config, importing or exporting a previously unknown interface enters it in the current config as a "present" interface; in a transparent config, importing or exporting a previously unknown interface enters it in the current config as transparent (meaning that the "present" interface is obtained from an ancestor).
interfaces: Environ,
started: BOOL ¬ FALSE
];
Environ: TYPE ~ REF EnvironRep;
EnvironRep: TYPE ~ RECORD [
SELECT kind: * FROM
list => [list: LIST OF Interface],
reftab => [tab: RefTab.Ref]
ENDCASE
];
Program: TYPE ~ REF ProgramRep;
ProgramRep: PUBLIC TYPE ~ RECORD [
name: CString,
frame: GlobalFrame,
type: Type,
main: PROC,
parent: Config,
exportsTo: LIST OF ExportItem,
started: BOOL
];
ControlModule: TYPE ~ RECORD[
first: ProgramAndConfigList,
last: ProgramAndConfigList
];
ExportItem: TYPE ~ RECORD[interface: Interface, item: INT];
ProcDescriptor: TYPE ~ RECORD[ code: POINTER, linkInfo: LinkInfo];
LinkInfo: TYPE ~ MACHINE DEPENDENT { global(0), local(1), unbound(2), last(CARD.LAST) };
a LinkInfo field may contain an address in the case of a closure.
Proc: TYPE ~ POINTER TO ProcDescriptor;
TrapDescriptor: TYPE ~ RECORD[ procDesc: ProcDescriptor, shadowedProc: PROC];
ProgramOrConfig: TYPE ~ MesaLoadState.ProgramOrConfig;
ProgramAndConfigList: TYPE ~ LIST OF ProgramOrConfig;
GlobalFrame: TYPE ~ POINTER; -- not dereferenced. Only used to identify mesa PROGRAMs in the environment
InstallationProblems: TYPE ~ MesaLoadState.InstallationProblems;
DefaultProblemPrinter: PROC [problems: InstallationProblems];
prints the problems on the standard output stream. (Probably not what you want, except at the lowest levels of the system).
END.