DIRECTORY DragOpsCross USING [Word]; CacheModel: CEDAR DEFINITIONS = BEGIN Word: TYPE = DragOpsCross.Word; wordsPerPage: CARDINAL = 1024; CacheBase: TYPE = REF CacheBaseRep; CacheBaseRep: TYPE = RECORD [ private: REF _ NIL, -- private data to the cache implementation fetch: CacheFetchProc _ NIL, -- this hook allows the user to intercept cache accesses store: CacheStoreProc _ NIL, -- this hook allows the user to intercept cache accesses data: REF _ NIL, -- private data for clients intercepting fetch & store stats: CacheStats _ [] -- maintained by the default fetch and store routines ]; CacheFetchProc: TYPE = PROC [base: CacheBase, addr: Word, fromJump: BOOL _ FALSE]; CacheStoreProc: TYPE = PROC [base: CacheBase, addr: Word]; CacheStats: TYPE = RECORD [ probes: INT _ 0, chunkMisses: INT _ 0, lineMisses: INT _ 0, jumpMisses: INT _ 0, mapMisses: INT _ 0, dirtyWrites: INT _ 0 ]; NewCache: PROC [lines: [0..4096), quadsPerLine: [0..8), lru: BOOL _ FALSE] RETURNS [CacheBase]; ResetCache: PROC [cache: CacheBase]; FlushCache: PROC [cache: CacheBase]; Fetch: PROC [base: CacheBase, addr: Word, afterJump: BOOL _ FALSE] = INLINE { base.fetch[base, addr, afterJump]}; Store: PROC [base: CacheBase, addr: Word] = INLINE {base.store[base, addr]}; END. €CacheModel.mesa Copyright c 1984 by Xerox Corporation. All rights reserved. Russ Atkinson, July 19, 1984 10:46:06 pm PDT Last Edited by: Sweet, March 19, 1985 10:19:44 am PST Creates a new cache on the specified shared memory. If lines = 0, then the default # of lines is used. Resets the given cache to its initial state. Forget everything it knows, but don't effect stats. ΚŸ˜šœ™Jšœ Οmœ1™