-- Runtime.mesa (last edited by: Sandman on: August 26, 1980  12:18 PM)
-- Copyright  Xerox Corporation 1979, 1980

DIRECTORY
  Mopcodes USING [zKFCB],
  SDDefs USING [sCallDebugger, sUnNew],
  System USING [GreenwichMeanTime];

Runtime: DEFINITIONS =
  BEGIN

  -- Global Frame management

  GlobalFrame: PROCEDURE [link: UNSPECIFIED] RETURNS [PROGRAM];

  --NewConfig: PROCEDURE [file: File.Capability];
  --RunConfig: PROCEDURE [file: File.Capability];

  UnNewConfig: PROCEDURE [link: UNSPECIFIED];
  UnNew: PROCEDURE [frame: PROGRAM] = MACHINE CODE
    BEGIN Mopcodes.zKFCB, SDDefs.sUnNew END;

  SelfDestruct: PROCEDURE;

  -- Frame validation

  ValidateGlobalFrame: PROCEDURE [frame: UNSPECIFIED];
  InvalidGlobalFrame: ERROR [frame: UNSPECIFIED];
  ValidateFrame: PROCEDURE [frame: UNSPECIFIED];
  InvalidFrame: ERROR [frame: UNSPECIFIED];

  -- Debugger interface

  CallDebugger: PROCEDURE [STRING] = MACHINE CODE
    BEGIN Mopcodes.zKFCB, SDDefs.sCallDebugger END;

  Interrupt: PROCEDURE = INLINE {};

  -- Build information

  GetBcdTime: PROCEDURE RETURNS [System.GreenwichMeanTime];
  GetBuildTime: PROCEDURE RETURNS [System.GreenwichMeanTime];

  -- Debugging information

  GetCaller: PROCEDURE RETURNS [PROGRAM];

  -- Access to compiled tables, etc
  --GetTableBase: PROCEDURE [frame: PROGRAM] RETURNS [LONG POINTER];
  -- Conditional loading information

  IsBound: PROCEDURE [link: UNSPECIFIED] RETURNS [BOOLEAN];

  -- Signals and errors generated by the Pilot Mesa System and of interest to Mesa programmers

  BoundsFault: SIGNAL;

  --ConfigError: ERROR [type: ConfigErrorType];
  --ConfigErrorType: TYPE = {badCode, invalidConfig, missingCode, versionMismatch, unknown};

  ControlFault: SIGNAL [source: UNSPECIFIED --ControlLink--]
    RETURNS [UNSPECIFIED --ControlLink--];
  DivideCheck: SIGNAL;
  LinkageFault: ERROR;
  PointerFault: SIGNAL;
  PortFault: ERROR;
  StartFault: SIGNAL [dest: PROGRAM];
  StackError: ERROR;
  UnboundProcedure: SIGNAL [dest: UNSPECIFIED --ControlLink--]
    RETURNS [UNSPECIFIED --ControlLink--];
  ZeroDivisor: SIGNAL;
  END.