-- XMesaDefs.Mesa  Edited for XMesa by Levin on:  April 18, 1979  12:53 PM

DIRECTORY
  AltoDefs: FROM "altodefs" USING [PageNumber, PageCount],
  BitBltDefs: FROM "bitbltdefs" USING [BBptr],
  SegmentDefs: FROM "segmentdefs" USING [SegmentHandle, FileSegmentHandle, DataSegmentHandle],
  MemoryOps: FROM "memoryops" USING [BankIndex];

XMesaDefs: DEFINITIONS =
  BEGIN

  -- XM Memory Management

  XVMtoSegment: PROCEDURE [a: LONG POINTER] RETURNS [SegmentDefs.SegmentHandle]; 
  XSegmentAddress: PROCEDURE [seg: SegmentDefs.SegmentHandle] RETURNS [LONG POINTER]; 

  XVMtoDataSegment: PROCEDURE [a: LONG POINTER] RETURNS [SegmentDefs.DataSegmentHandle]; 
  XDataSegmentAddress: PROCEDURE [seg: SegmentDefs.DataSegmentHandle] RETURNS [LONG POINTER]; 

  XVMtoFileSegment: PROCEDURE [a: LONG POINTER] RETURNS [SegmentDefs.FileSegmentHandle];
  XFileSegmentAddress: PROCEDURE [seg: SegmentDefs.FileSegmentHandle] RETURNS [LONG POINTER];

  ImmovableSegmentInXM: SIGNAL [SegmentDefs.SegmentHandle];

  -- Additional Definitions for Memory Allocation

  PagesPerBank: AltoDefs.PageCount = LAST[AltoDefs.PageCount];
  MaxXPage: AltoDefs.PageNumber = 1777B;

  -- The following are passed as the 'base' parameter to MakeSwappedIn, NewDataSegment, and
  -- related procedures.

  DefaultBase0: AltoDefs.PageNumber = MaxXPage+1;
  DefaultBase1: AltoDefs.PageNumber = DefaultBase0+1;
  DefaultBase2: AltoDefs.PageNumber = DefaultBase1+1;
  DefaultBase3: AltoDefs.PageNumber = DefaultBase2+1;
  DefaultMDSBase: AltoDefs.PageNumber = DefaultBase3+1;
  DefaultXMBase: AltoDefs.PageNumber = DefaultMDSBase+1;

  -- LONG POINTER support

  XCOPY: PROCEDURE[from: LONG POINTER, nwords: CARDINAL, to: LONG POINTER];

  LongAddressFromPage: PROCEDURE[page: AltoDefs.PageNumber] RETURNS[lp: LONG POINTER];
  PageFromLongAddress: PROCEDURE[lp: LONG POINTER] RETURNS[page: AltoDefs.PageNumber];

  InvalidLongPointer: ERROR [lp: LONG POINTER];
  InvalidXMPage: ERROR [page: AltoDefs.PageNumber];


  -- Miscellaneous

  XBitBlt: PROCEDURE[bbt: BitBltDefs.BBptr, bank: MemoryOps.BankIndex];

  XMNotAvailable: ERROR;

  END.