-- FrameOps.Mesa  Edited by Sandman on June 30, 1980  4:54 PM
-- Copyright  Xerox Corporation 1979, 1980

DIRECTORY
  ControlDefs USING [
    ControlLink, ControlModule, FrameHandle, GlobalFrameHandle, returnOffset],
  Mopcodes USING [zALLOC, zFREE, zGADRB, zKFCB, zLADRB, zLLB, zSLB],
  SDDefs USING [sCopy],
  SegmentDefs USING [FileSegmentHandle];

FrameOps: DEFINITIONS =
  BEGIN OPEN ControlDefs;

  GetReturnLink: PROCEDURE RETURNS [ControlLink] = MACHINE CODE
    BEGIN Mopcodes.zLLB, returnOffset END;

  GetReturnFrame: PROCEDURE RETURNS [FrameHandle] = LOOPHOLE[GetReturnLink];
  SetReturnLink: PROCEDURE [ControlLink] = MACHINE CODE
    BEGIN Mopcodes.zSLB, returnOffset END;

  SetReturnFrame: PROCEDURE [FrameHandle] = LOOPHOLE[SetReturnLink];

  MyLocalFrame: PROCEDURE RETURNS [FrameHandle] = MACHINE CODE
    BEGIN Mopcodes.zLADRB, 0 END;

  MyGlobalFrame: PROCEDURE RETURNS [GlobalFrameHandle] = MACHINE CODE
    BEGIN Mopcodes.zGADRB, 0 END;

  Start: PROCEDURE [ControlModule];
  Restart: PROCEDURE [GlobalFrameHandle];
  FlushLargeFrames: PROCEDURE;
  FrameSize: PROCEDURE [CARDINAL] RETURNS [CARDINAL];
  MakeFsi: PROCEDURE [words: CARDINAL] RETURNS [fsi: CARDINAL];
  ValidGlobalFrame: PROCEDURE [GlobalFrameHandle] RETURNS [BOOLEAN];

  Copy: PROCEDURE [old: GlobalFrameHandle] RETURNS [new: GlobalFrameHandle] =
    MACHINE CODE BEGIN Mopcodes.zKFCB, SDDefs.sCopy END;

  Alloc: PROCEDURE [CARDINAL] RETURNS [POINTER] = MACHINE CODE
    BEGIN Mopcodes.zALLOC END;

  Free: PROCEDURE [POINTER] = MACHINE CODE BEGIN Mopcodes.zFREE END;

  CodeHandle: PROCEDURE [frame: GlobalFrameHandle]
    RETURNS [seg: SegmentDefs.FileSegmentHandle];
  ReleaseCode: PROCEDURE [GlobalFrameHandle];

  END.