DIRECTORY BcdDefs USING [MTIndex], LoadState USING [BcdBase, CopiesList, GlobalFrameHandle, ModuleIndex, Type]; LoadStateFormat: DEFINITIONS = BEGIN OPEN LoadState; Handle: TYPE = REF Object; Object: TYPE = RECORD [ -- concrete version of LoadState.Object useCount: INTEGER, -- -1 = exclusive, 0 = not in use, >0 = shared changeCount: INT _ 0, configTable: REF ConfigTable, -- -> gf mapping copyTable: REF CopyTable, collisionTable: REF CollisionTable, -- gfht: ARRAY HashIndex OF Entry -- gf -> mapping ]; htSize: NAT = 1019; HashIndex: TYPE = NAT[0..htSize); EntryType: TYPE = {empty, collision, copy, original}; Entry: TYPE = RECORD [ SELECT type: EntryType FROM empty => NULL, collision => [list: CollisionTableIndex], -- appears only in hash table copy => [ copyIndex: CopyIndex, gfh: GlobalFrameHandle -- superfluous if Entry is in hash table ], original => [ copyIndex: ShortCopyIndex, configID: ConfigID, module: ModuleIndex ], ENDCASE ]; ConfigID: TYPE = NAT[0..256); CollisionTableIndex: TYPE = NAT; CollisionTable: TYPE = RECORD [ nCollisions: CollisionTableIndex, collisions: SEQUENCE length: CollisionTableIndex OF CollisionList ]; CollisionList: TYPE = LIST OF Entry; ConfigTable: TYPE = RECORD [ nConfigs: NAT, configs: SEQUENCE length: NAT OF Config ]; Config: TYPE = REF ConfigObject; ConfigObject: TYPE = RECORD [ bcd: BcdBase, nModules: NAT, modules: SEQUENCE length: NAT OF ModuleEntry -- replicated entries for multi-gft modules ]; ModuleEntry: TYPE = RECORD [ mti: BcdDefs.MTIndex, gfh: GlobalFrameHandle, type: Type ]; CopyIndex: TYPE = NAT[0..37777B]; -- packs with EntryType in a word ShortCopyIndex: TYPE = NAT[0..77B]; -- packs with EntryType and ConfigID into a word nullCopyIndex: CopyIndex = 0; fuzzyCopyIndex: CopyIndex = ShortCopyIndex.LAST; CopyTable: TYPE = RECORD [ nCopies: CopyIndex, copies: SEQUENCE length: NAT OF CopyEntry ]; CopyEntry: TYPE = RECORD [ parent: GlobalFrameHandle, copies: CopiesList ]; END. LoadStateFormat.mesa last edited by Levin on June 17, 1983 2:04 pm Selection criteria: prime expected number of modules / htsize ~= 1 SIZE[Entry]*htSize-3*SIZE[REF] is nearly a multiple of the virtual memory page size. This is arranged to occupy a maximum of two words Ê1˜Jšœ™Jšœ-™-J˜šÏk ˜ Jšœœ ˜Jšœ œ=˜L—J˜Jšœ œ˜J˜Jš˜J˜Jšœ ˜J˜J˜Jšœœœ˜J˜šœœœÏc'˜@Jšœ œž.˜BJšœ œ˜Jšœ œž˜@Jšœ œ ˜Jšœœ˜)Jšœœ œž!˜AJ˜—J˜šœœ˜šœ™Jšœ™Jšœ(™(JšœT™T——J˜Jšœ œœ ˜!J˜Jšœ œ&˜5šœœœ˜Jšœ1™1šœ˜Jšœ œ˜Jšœ+ž˜Hšœ ˜ Jšœ˜Jšœž(˜@Jšœ˜—˜ J˜J˜J˜J˜—Jš˜—J˜—J˜Jšœ œœ ˜J˜Jšœœœ˜ šœœœ˜Jšœ!˜!Jšœ œœ˜AJ˜—Jšœœœœ˜$J˜šœ œœ˜Jšœ œ˜Jšœ œ œœ˜'J˜—J˜Jšœœœ˜ šœœœ˜Jšœ ˜ Jšœ œ˜Jšœ œ œœž+˜YJ˜—šœ œœ˜J˜J˜J˜ J˜—J˜Jšœ œœž!˜DJšœœœ ž0˜UJšœ˜Jšœ+œ˜0J˜šœ œœ˜Jšœ˜Jšœœ œœ ˜)J˜—J˜šœ œœ˜J˜J˜J˜—J˜J˜Jšœ˜—…—Þ #