:TITLE[Mesa2Occupied];

%Edit by Fiala 18 March 1982: Eliminate IFDC stuff on page 17b; change
Fault.Mc reserve on page 17b; change for 10 mb Ethernet stuff; changes
to make reservations explicit except on pages 4-7; absorb IMReserve for
MIOC formerly in MIOC.Mc.
Edit by Fiala 8 October 1981: Allow for MidasPage in Fault.Mc; assign
almost all of page 0 to Pilot1 for Fault.Mc; give unused page 3 to Pilot2.
Edit by Fiala 15 June 1981: Reduce Midas Kernel reserve.
Edit by Fiala 27 April 1981: Add page 17 reserve to allow Pilot2 to use page
17; changes for movement of XWTask, XWSio2, TextBlt, MesaFP; incorporate
LoadRAMOccupied here; fix for page 0 reserve.
Edit by Fiala 20 March 1981: Add reserve for Initial’s timer task
on page 11 for Kernel’s on page 16 (as a comment), and for MesaFP
on page 13.
Edit by Joiner December 15, 1980 3:02 PM add reserve for textblt


Reserve ALL locations that must not be smashed by code in Pilot1. This
includes those occupied by Initial during LoadRAM or by Midas when debugging
and those locations reserved for Pilot2 (or subsequent overlays) that are on
pages where Pilot1 code will have to remain after initialization. Pages 4-7
are totally overwritten by Pilot2 and not reserved here; these may be used
for throwaway initialization in Pilot1, and, by convention, are the ONLY
pages currently used for throwaway initialization. Pages 4-7 may not be
used for anything that must remain after initialization.

On pages shared between Pilot1 and Pilot2, the union of IMReserve’s in the
occupied files is, by convention, 400b words, so unintentional overwriting
always produces an error, though sometimes a fictitious one which can be fixed
by moving some excess reserved locations between the Occupied files.

The fault handler in Pilot1 substitutes for that in Initial/Kernel, so the
corresponding locations in Initial/Kernel are not reserved here.
%

IMReserve[0,2,3];
*For 3 mi in MesaJ.Mc buffer refill + 1 mi after
IMReserve[0,10,3];
*InitEnd in MesaX.Mc - 1 mi at Qloc (.eq. 5)
IMReserve[0,20,1];
*InitEnd in Pilot2 MesaX, placed with At
IMReserve[0,300,40];
*LoadRAM.Mc in Initial
IMReserve[0,370,2];
*LoadRAM.Mc

*Page 1 is used by ENXTask or by EOMLoTask.
*Page 2 is used by EOMHiTask, MIOC, or CedarGC.

:IF[WithMIOC]; ***********************************
IMReserve[2,0,235];
*For MIOC overlays (MIOCBit, MIOCByte, MIOCAsync,
*or MIOCTTY); this code could be bummed a lot
*if needed for some reason.
:ENDIF;*******************************************

:IF[WithGarbCollect]; ****************************
IMReserve[2,0,400];
*For CedarGC.Mc
:ENDIF;*******************************************

IMReserve[3,0,400];
*For MesaIO, CedarGC, and ?

IMReserve[10,0,400];
*For MesaX, MesaFP, etc.

IMReserve[11,0,400];
*Initial’s timer task code and Pilot2’s BitBlt.Mc.
*Initial could be changed so that only a few
*locations had to be reserved.

*Page 12 is for the UTVFC or UIB display driver in Pilot1.

*Page 13 is for RDC.Mc and XWSIO2.Mc

*Page 14 is used by XWTask, Timer, and CDCTask.
IMReserve[14,360,20];
*Pilot2 will overwrite any unused TimerTable
*entries (not IMReserved here because they are
*initialized to cause a crash) and may use the
*last 20b locations of TimerPage for offpage jumps.

IMReserve[15,0,400];
*xfPage1 for MesaX.Mc, etc.

IMReserve[16,0,400];
*MesaP.Mc
:IF[WithMidas]; **********************************
*IMReserve[16,1,14];
*Midas Kernel timer task code (unnecessary to
*reserve this here so long as Initial is loaded
*ahead of Pilot1).
:ENDIF; ******************************************

%The current policy for page 17 allocation is as follows:
If WithMidas=1, 31b locations are given to Pilot1 for MidasPage in Fault.Mc,
and 117b locations are reserved for the Midas Kernel; otherwise, these
locations are given to Pilot2.
%
:IF[WithFloatingPoint]; **************************
IMReserve[17,0,377];
*For MesaFP.Mc
:ELSE; *******************************************
:IF[WithMidas]; **********************************
IMReserve[17,1,2];
*Midas Kernel resident
IMReserve[17,4,74];
*Kernel resident
IMReserve[17,100,20];
*Kernel overlays
IMReserve[17,120,1];
*Kernel resident
:ELSE; *******************************************
IMReserve[17,1,2];
*Unused locations given to Pilot2 (Same as
IMReserve[17,4,115];
*Kernel reserve)
IMReserve[17,0,1];
*Reserve 31b locations that would be occupied
IMReserve[17,3,1];
*by MidasPage in Fault.Mc
IMReserve[17,121,27];
:ENDIF; ******************************************
IMReserve[17,150,227];
*Unused given to Pilot2
:ENDIF; ******************************************
IMReserve[17,377,1];
*7777b unusable with LoadRAM.

:END[Mesa2Occupied];