-- XMesaPrivateDefs.Mesa Edited by Levin on October 16, 1978 3:40 PM DIRECTORY AllocDefs: FROM "AllocDefs" USING[AllocInfo], AltoDefs: FROM "altodefs" USING [BytesPerPage, MaxVMPage, PageNumber, PageSize], AltoFileDefs: FROM "altofiledefs" USING [FP, vDA], SegmentDefs: FROM "segmentdefs" USING [FrobLink, FrobSize, ObjectType, SegmentType, FileSegmentClass, FileHandle, FileSegmentHandle, LockCount, SegmentLocation, FileHint, RemoteSegProc, RefCount, SegCount], XMesaDefs: FROM "XMesaDefs" USING [BankIndex, MaxXPage, MemoryConfig]; XMESA: DEFINITIONS SHARES SegmentDefs = BEGIN OPEN AltoDefs, SegmentDefs; -- Primitive System Objects: XSegmentObject: PRIVATE TYPE = segment XObject; XFileObject: PRIVATE TYPE = file XObject; XSegmentHandle: PRIVATE TYPE = POINTER TO XSegmentObject; XFileHandle: PRIVATE TYPE = POINTER TO XFileObject; XFileSegmentObject: PRIVATE TYPE = file XSegmentObject; XFileSegmentHandle: PRIVATE TYPE = POINTER TO XFileSegmentObject; XDataSegmentObject: PRIVATE TYPE = data XSegmentObject; XDataSegmentHandle: PRIVATE TYPE = POINTER TO XDataSegmentObject; XObject: PRIVATE TYPE = RECORD [ busy: PRIVATE BOOLEAN, body: SELECT tag: ObjectType FROM free => [ seal: PRIVATE [0..37B], size: PRIVATE FrobSize, fwdp, backp: PRIVATE FrobLink], segment => [ SELECT type: SegmentType FROM data => [ unused: [0..1], XMpage: [0..XMesaDefs.MaxXPage], pages: [1..MaxVMPage+1], VMpage: [0..MaxVMPage]], file => [ swappedin: BOOLEAN, read, write: BOOLEAN, class: FileSegmentClass, VMpage: [0..MaxVMPage], file: FileHandle, base: PageNumber, pages: [1..MaxVMPage+1], lock: LockCount, location: SELECT loc: SegmentLocation FROM disk => [ hint: FileHint], remote => [ proc: RemoteSegProc, info: POINTER TO XSegInfo], ENDCASE], ENDCASE], file => [ open: BOOLEAN, length: BOOLEAN, lengthvalid: BOOLEAN, read, write, append: BOOLEAN, lock: LockCount, lengthchanged: BOOLEAN, unused: [0..177B], swapcount: RefCount, segcount: SegCount, fp: AltoFileDefs.FP], length => [ unused: [0..7B], byte: [0..BytesPerPage], page: PageNumber, file: FileHandle, da: AltoFileDefs.vDA], ENDCASE]; XMremote: RemoteSegProc = LOOPHOLE[123123B]; XSegInfo: PRIVATE TYPE = RECORD[ seal: [0..77B], XMpage: [0..XMesaDefs.MaxXPage], body: SELECT OVERLAID * FROM free => [link: POINTER TO XSegInfo, freeCount: CARDINAL], hint => [hint: FileHint], ENDCASE]; InUseSeal: [0..77B] = 63B; FreeSeal: [0..77B] = 14B; XSegInfoIndex: TYPE = [0..(PageSize-2)/SIZE[XSegInfo]); -- 2 words for header at front of page XSegInfoTable: PRIVATE TYPE = RECORD[ nextPage: [0..MaxVMPage], freeCount: [0..LAST[XSegInfoIndex]+1], freeHead: POINTER TO XSegInfo, table: ARRAY XSegInfoIndex OF XSegInfo]; ChocolateToVanilla: PROCEDURE [XFileSegmentHandle, PageNumber] RETURNS [PageNumber]; VanillaToChocolate: PROCEDURE [FileSegmentHandle, PageNumber] RETURNS [PageNumber]; BankOption: TYPE = [0..4]; AnyBank: BankOption = 4; Bank1X: PageNumber = 256; Bank2X: PageNumber = 257; Bank3X: PageNumber = 258; memoryConfig: POINTER TO XMesaDefs.MemoryConfig = LOOPHOLE[3B]; InitMemoryConfig: PROCEDURE; BankMasks: ARRAY XMesaDefs.BankIndex OF CARDINAL = [10B, 4B, 2B, 1B]; EnableBank, DisableBank: PROCEDURE[XMesaDefs.BankIndex]; -- Miscellaneous SwapOutFileSegment: PROCEDURE[SegmentDefs.FileSegmentHandle]; MoveLockedCode: PROCEDURE[direction: WhichWay]; WhichWay: TYPE = {down, up}; PageMapAllocInfo: AllocDefs.AllocInfo = AllocDefs.AllocInfo[0, easy, topdown, initial, other, FALSE, FALSE]; END.