-- MesaRuntimePack.pack
-- Last edit by:
-- Yokota  March 23, 1981  10:00 AM  FrameImpl in Resident pack is moved into ResidentCool. All the procedures in Instructions are moved from Resident to ResidentCool. Several procedures are interchanged between ProcessesHot and ProcessesCold. Processes in Resident is moved to ResidentCool. GetCaller is moved from FrameImplHot to ResidentCool.

-- Gobbel  March 1, 1981  2:04 PM  Moved Process.SetTimeout, MsecToTicks, and EnableAborts into ResidentCool (for SoundGenerator on DLion).

-- Gobbel  February 23, 1981  11:53 AM  Moved Process.Pause into ResidentCool (for SoundGenerator on DLion).

-- Gobbel  January 31, 1981  11:33 AM  Moved frame packs into PilotKernelFrames.pack.

-- Gobbel January 26, 1981  5:02 PM  Put PilotNub.InitializeDeviceCleanup in Resident code pack.

-- January 20, 1981  10:55 AM   Knutsen   Deleted duplicate frame of Signals - it's now Cold.  Rearraged Processes code pack, deleted CheckProcess.  FrameImpl's frame and fault handler must be resident.  Procedures moved from Traps to FrameImpl.  Misc procedures appearing and disappearing.  Traps now swappable.  InLoadFromBootLocation no longer resident, InitializeInLoadFromBootLoc is.  GetPriority, SetPriority now resident.

-- Gobbel January 19, 1981  4:19 PM  Created ResidentCool code pack

MesaRuntime: SEGMENT =
BEGIN

Resident: CODE PACK =
  BEGIN
  BootSwapCross EXCEPT Initialization;
  PilotNub [InitializeDeviceCleanup];
  -- InitializeInLoadFromBootLoc is vanilla resident so that it won't be mapped
  --  with non-PrincOps memory.
  SnapshotImpl [InitializeInLoadFromBootLoc];
  END;

ResidentCool: CODE PACK = -- goes into display memory on Dandelion
  BEGIN
  -- GetCaller is moved from FrameHotImpl since Star often uses it
  FrameImpl [Codebase, FrameFaultProcess, FrameSize, GetCaller];
  Instructions EXCEPT Initialization;
  PilotNub EXCEPT Initialization, Resident;
  -- BootButton is resident so it is always available.
  -- Process stuff is here because it gets used by SoundGenerator.Beep
  -- GetPriority, SetPriority are used by the Swapper
  Processes [EnableAborts, MsecToTicks, Pause, SetTimeout, GetPriority, SetPriority];
  SnapshotImpl [BootButton];
  END;
  
FrameImplHot: CODE PACK =
  -- The following have been chosen basically at random only under
  -- the constraint that this pack take up only one page.
  -- GetCaller is here explicitly as it makes the working set
  -- for owner checking (in HeapImpl) smaller.
  {FrameImpl [InGFT, IsBound, ValidateFrame, ValidateGlobalFrame]};
  
FrameImplCold: CODE PACK =
  {FrameImpl [AllocGlobalFrame, Copy, DeletedFrame, EntGlobalFrame, EnterGlobalFrame,
    GetBcdTime, GetBuildTime, GetNextGlobalFrame, GetNxGlobalFrame, GlobalFrame, MakeFsi,
    RemoveGlobalFrame, RemvGlobalFrame, SelfDestruct, zUnNew]};
  
ProcessesHot: CODE PACK =
  {Processes [DisableAborts, DisableTimeout, GetCurrent, InitializeCondition,
    InitializeMonitor, SecondsToTicks, TicksToMsec, ValidateProcess, Yield]};
  
ProcessesCold: CODE PACK =
  {Processes [Abort, AllocateNakedCondition, DeallocateNakedCondition,
   Detach, End, Fork, Join, ProcessTrap]};
  
InLoadOutLoad: CODE PACK =
  {SnapshotImpl [BootFromFile, BootFromVolume, BootFromPhysicalVolume,
   GetBootFileSize, GetDevice, InLoad, InLoadFromBootLocation, OutLoad]};
  
Signals: CODE PACK =
  {Signals EXCEPT Initialization};
  
SnapshotMisc: CODE PACK =
  {SnapshotImpl [InstallPhysicalVolumeBootFile,
   InstallVolumeBootFile, MakeBootable, MakeUnbootable]};
  
Traps: CODE PACK =
  {Traps [BoundsFaultTrap, CodeTrap, ControlFaultTrap, DivideCheckTrap, HardwareErrorTrap,
   PointerFaultTrap, Restart, StackErrorTrap, Start, StartCM, StartWithState,
   UnboundProcedureTrap, WakeupErrorTrap, ZeroDivisorTrap] };
  
Initialization: CODE PACK =
  BEGIN
  BootSwapCross [MAIN];
  FrameImpl [InitializeFrameImpl, MAIN];
  Instructions [InitializeInstructions, MAIN];
  PilotNub [InitializeInterrupt, InitializePilotNub, Install, MAIN];
  Processes [InitializeProcesses, MAIN];
  Signals [InitializeSignals, MAIN];
  SnapshotImpl [InitializeSnapshot, MAIN];
  Traps [Initialize, MAIN];
  END;
END;