-- SpecialSpace.mesa  (last edited by: Levin on: August 25, 1982 9:01 am)

DIRECTORY
  Space USING [defaultBase, Handle, PageCount, PageNumber, PageOffset];

SpecialSpace: DEFINITIONS =

BEGIN

CreateForCode: PROC [
  size: Space.PageCount, parent: Space.Handle, base: Space.PageOffset ← Space.defaultBase]
  RETURNS [newSpace: Space.Handle];
  -- Create a space guaranteed not to cross a 64K boundary.

CreateAligned: PROC [
  size: Space.PageCount, parent: Space.Handle, alignment: Space.PageCount ← 0]
  RETURNS [newSpace: Space.Handle];
  -- Create a space which begins at a page within the parent which is guaranteed to start on an appropriate boundary.  If the alignment parameter is 0, this boundary is an integral multiple of the smallest power of two not less than the given size.  (Thus if size is already a power of two, the beginning page number will have at least as many low-order zero bits as does size.)  If the alignment parameter is non-zero, the boundary is an integral multiple of the smallest power of two not less than the given alignment.  Note:  this somewhat peculiar treatment of the alignment parameter permits backward compatibility with Rubicon semantics.

MakeResident, MakeSwappable: PROC [space: Space.Handle];
  -- Make the space resident/swappable.

MakeCodeResident, MakeCodeSwappable: PROC [frame: PROGRAM];
  -- Make the swap unit containing the first word of the code segment of the program resident/swappable.

MakeGlobalFrameResident, MakeGlobalFrameSwappable: PROC [frame: PROGRAM];
  -- Make the swap unit containing the global frame of the program resident/swappable.

MakeProcedureResident, MakeProcedureSwappable: PROC [
  proc: --procedure PrincOps.ControlLink-- UNSPECIFIED];
  -- Make the swap unit containing the first word of the code of the procedure resident/swappable.

DonateDedicatedRealMemory: PROC [page: Space.PageNumber, size: Space.PageCount];
  -- Take any real memory mapped (in the PrincOps sense) to the specified virtual pages and move it to Pilot's swapping pool.  The virtual pages should lie within a space which is not mapped (in the Pilot sense); on return they will no longer be mapped (in the PrincOps sense).  This operation is useful for hardware configurations containing dedicated real memory not normally accessed through the virtual memory (e.g. special I/O buffers) when an application doesn't use the function for which the real memory is dedicated and could use the extra swapping memory.

realMemorySize: READONLY Space.PageCount;
  -- Maximum amount of real memory which might be present in virtual memory, including dedicated real memory (e.g. Dandelion display bitmap, but not Dandelion page map).

END.

LOG

Time: August 28, 1978  10:07 AM	By: Lauer	Action: Created file
Time: July 10, 1979  12:06 PM	By: Knutsen	Action: Made compatible with Teak interfaces
Time: August 9, 1979  6:41 PM	By: McJones	Action: Added realMemorySize
Time: January 25, 1980  7:49 PM	By: Forrest	Action: Added default base for CreateForCode
Time: June 5, 1980  2:00 PM	By: Knutsen	Action: Added MakeGlobalFrame*, MakeProcedure*, etc
Time: June 17, 1980  1:15 PM	By: McJones	Action: Added CreateAligned
Time: September 2, 1980  3:35 PM	By: McJones	Action: Added DonateDedicatedRealMemory
Time: August 25, 1982 9:01 am	By: Levin	Action: Added CreateAligned's alignment parameter.