// VMem.decl - data structures and constants common to VMemInit and VMemB
// Edited April 11, 1982  4:44 PM by Bill van Melle
// File created on November 20, 1980  12:23 AM by Beau Sheil

structure BPT:			// length is known in Vmema.asm
 [ NEXT word			// next buffer in chain *** MUST BE FIRST
   VP word = [ STATE word	// various overflow values mean empty or NA 
             ]
   FWORD word = [ LOCK bit	// page is locked 
                  FILEP bit 15	// page number in file
                ]
 ]

manifest
 [ LastVirtualPage = #37777	// for 22-bit address space
   lBPT = size BPT/16
   EMPTY = #40000		// assumes 22-bit addresses!
   UNAVAIL = #40400
   LOCKbit = #100000		// in pagemap, signals locked page
 ]

// Hardware memory map definitions - Dorado Serial 1 compatible

manifest
  [	REFbit   = #100000
	DIRTYbit =  #10000
	VACANT   =  #30000
	OCCUPIED =      #0
  ]

structure PVP:			// paged virtual page number
 [ key1 bit 11			// first level key
   key2 bit  5			// second level key = log PMBLOCKSIZE
 ]

manifest
 [ MaxKey1 = #777		// for 22-bit addresses, largest primary key
   MaxKey2 = #37
   PMTspaceVP = PMTspace lshift 8 + PMTbase rshift 8
   PAGEMAPvp = PAGEMAPspace lshift 8 + PAGEMAPbase rshift 8
 ]


external [ @Bpt; @BptLast; BptSize; @BufVp; @BufRP; @RPoffset; LogPagingFlag ]