-- File: VMControl.mesa
-- Last edited by Gobbel: 18-May-81 11:17:25
-- Last edited by Levin:  26-Nov-80 16:52:38
-- hankins	25-Jul-84 13:52:34	Klamath update (IsBound)

DIRECTORY
  Runtime USING [IsBound],
  LogDefs USING [DisplayNumber],
  VMStorage USING [InitializeStorage, FinalizeStorage],
  VMDefs USING [CacheIndex],
  VMPrivate USING [
    FinalizeVMCache, FinalizeVMFile, FinalizeVMIO, FinalizeVMPageMgr,
    InitializeVMCache, InitializeVMFile, InitializeVMIO, InitializeVMPageMgr];

VMControl: PROGRAM
  IMPORTS LogDefs, Runtime, VMPrivate, VMStorage
  EXPORTS VMDefs, VMPrivate
  SHARES VMStorage =

  BEGIN OPEN VMPrivate;


  -- Procedures and Variables Exported to VMPrivate --

  InitializeVM: PUBLIC PROCEDURE [
    min, max: VMDefs.CacheIndex, numOps: CARDINAL ← 20] =
    BEGIN
    loggingEnabled ← Runtime.IsBound[LOOPHOLE[LogDefs.DisplayNumber]];
    VMStorage.InitializeStorage[];
    InitializeVMIO[];
    InitializeVMPageMgr[];
    InitializeVMCache[min, max];
    InitializeVMFile[max];
    END;

  FinalizeVM: PUBLIC PROCEDURE =
    BEGIN
    FinalizeVMFile[];
    FinalizeVMCache[];
    FinalizeVMPageMgr[];
    FinalizeVMIO[];
    VMStorage.FinalizeStorage[];
    END;

  loggingEnabled: PUBLIC BOOLEAN;

  END.