Text preview for : UnNewConfig.mesa_Sep78.pdf part of xerox UnNewConfig.mesa Sep78 xerox mesa 4.0_1978 listing Mesa_4_System UnNewConfig.mesa_Sep78.pdf
Back to : UnNewConfig.mesa_Sep78.pd | Home
, UnNewConfig .mesa 2-Sep-78 18:05:56 Page 1
-- UnNewConfig.mesa; edited by Sandman on Aug 31, 1978 5:04 PM
DIRECTORY
BcdDefs: FROM "bcddefs" USING [MTHandle, MTIndex, UnboundLink],
ControlDefs: FROM "controldefs" USING [
ControlLink, FrameCodeBase, Free, GFT, GFTIndex, GFTItem,
GlobalFrameHandle, NullGlobalFrame, TrapLink],
FrameDefs: FROM "framedefs" USING [
EnumerateGlobalFrames, GlobalFrame, LockCode, UnlockCode, UnNew],
InlineDefs: FROM "inlinedefs" USING [BITAND],
LoaderBcdUtilDefs: FROM "loaderbcdutildeFs" USING [
BedBase, EnumerateMaduleTable, ReleaseBcdSeg, SetUpBed],
LaaderDefs: FROM "loaderdefs",
LoadStateDefs: FROM "loadstatedefs" USING [
BedAddress, BedSegFromLaadState, ConfigIndex, EnumerateLoadStateBcds,
InitializeRelocation, InputLoadState, MapRealTaConfig, ReleaseLoadState,
ReleaseReloeation, Relocation, RemoveConfig, SetUnresolvedImports],
SegmentDefs: FROM "segmentdefs" USING [
DeleteFileSegment, FileSegmentAddress, FileSegmentHandle, SwapError,
SwapIn, SwapUp, Unlock],
SystemDefs: FROM "systemdefs" USING [FreeSegment];
UnNewConfig: PROGRAM
IMPORTS FrameDeFs, LoadStateDefs, LoaderBcdUtilDefs, SegmentDefs, SystemDefs
EXPORTS LoaderDefs = BEGIN
ConfigIndex: TYPE = LoadStateDeFs.ConfigIndex;
Relocation: TYPE = LoadStateDefs.Relocation;
BcdBase: TYPE = LoaderBcdUtilDefs.BcdBase;
GlobalFrameHandle: TYPE = ControlDefs.GlobalFrameHandle;
NullGlobalFrame: GlobalFrameHandle = ControlDefs.NullGlabalFrame;
UnNewConfig: PUBLIC PROCEDURE [Frame: GlobalFrameHandle] =
BEGIN OPEN LaadStateDefs;
config: CanfigIndex;
rel: Relocat ion;
bcdseg: SegmentDefs.FileSe9mentHandle;
bcd: BcdBase;
FindOriginal: PROCEDURE [f: GlobalFrameHandle] RETURNS [BOOLEAN] ~
BEGIN
IF f # frame THEN
BEGIN
IF SameCode[frame, f] = identical AND ~f.copied THEN
BEGIN frame ~ f; RETURN[TRUE] END;
END;
RETURN[FALSE];
END;
IF frame.copied THEN [] ~ FrameDefs.EnumerateGlobalFrames[FindOriginal];
[] ~ InputLoadState[];
[config: config] ~ MapRealToConfig[frame.gfi];
bcdseg ~ BcdSegFromLoadState[conFig];
bcd ~ LoaderBcdUtilDefs.SetUpBcd[bcdseg];
rel ~ InitializeRelocation[config];
UnBindConFig[config, bcd, rel];
CleanupFrames[rel];
CleanupGFT[rel];
RemoveConfig[rel, config];
ReleaseRelocation[rel];
ReleaseLoadState[];
LoaderBcdUtilDeFs.ReleaseBcdSeg[bcdseg];
RETURN
END;
CodeMatch: TYPE = {identical. same, different};
SameCode: PROCEDURE [fl, f2: GlobalFrameHandle] RETURNS [CodeMatch]