// IfsVMem.decl - VMem declarations
// Copyright Xerox Corporation 1980, 1981
// Last modified November 14, 1981  4:42 PM by Taft

manifest
[
lenLT = 192		// VMem lock table length
maxVMPages = 256	// Maximum number of vmem pages (power of 2)
maxVMD = 30		// Maximum number of VMDs (>100 breaks VMemSpy)
lenHMap = 2*maxVMPages
// logStdPageLength = ?	// Defined in IFS.decl
logVMPageLength = 8	// Page length assumed by VMem package
]

//----------------------------------------------------------------------------
structure VMDT:		// Virtual memory descriptor table
//----------------------------------------------------------------------------
[
length word		// Present number of entries
version word		// Incremented every time VMDT is changed
vmd↑1,maxVMD word	// -> VMDs (maintained in increasing order of vPage)
]
manifest lenVMDT = size VMDT/16

//----------------------------------------------------------------------------
structure VMD:		// Virtual memory descriptor
//----------------------------------------------------------------------------
[
base word		// First virtual page
length word		// Number of virtual pages
vmi word		// -> VMI
// Client may put additional instance data here
]
manifest lenVMD = size VMD/16

//----------------------------------------------------------------------------
structure VMI:		// Virtual memory interface (procedures)
//----------------------------------------------------------------------------
[
DOPAGEIO word		// VMem interface procedures
CleanupLocks word
PageType word
PageGroupAlign word
PageGroupBase word
PageGroupSize word
type word		// Identifies purpose of this VMI (see below)
]
manifest lenVMI = size VMI/16

manifest
[
vmiTypeOverlay = 1	// Overlay pages
vmiTypeVFile = 2	// Virtual file pages (including B-Tree)
vmiTypeDD = 3		// DiskDescriptor pages
vmiTypeLeaf = 4		// Leaf pages
maxVMIType = 4
]

//----------------------------------------------------------------------------
structure FVMD:			// File virtual memory descriptor
//----------------------------------------------------------------------------
[
@VMD
fileMap word			// -> ISF file map
dirty bit			// file dirtied since write date last updated
logVPagesPerDiskPage bit 7	// VMEM pages per physical disk page
logPageGroupSize byte		// Usually same as logVPagesPerDiskPage
]
manifest lenFVMD = size FVMD/16

//----------------------------------------------------------------------------
structure VMXfers ↑1,maxVMIType word 2
//----------------------------------------------------------------------------

//----------------------------------------------------------------------------
structure VMStats:		// Virtual memory statistics
//----------------------------------------------------------------------------
[
// I tried to use @VMXfers in the following fields, but BCPL choked on it.
reads ↑1,maxVMIType word 2	// Read transfers for each VMI type
writes ↑1,maxVMIType word 2	// Write faults for each VMI type
ovDiskReads word 2		// Overlays read from disk
ovXMReads word 2		// Overlays read from XM
]
manifest lenVMStats = size VMStats/16