]> git.saurik.com Git - apple/bootx.git/blobdiff - bootx.tproj/fs.subproj/cache.c
BootX-74.1.tar.gz
[apple/bootx.git] / bootx.tproj / fs.subproj / cache.c
index 35af07201aae1d5c064eadc42302fd274f4a5e00..03ed81c1fd5c42e1cffbc396c8d0797abf09459a 100644 (file)
@@ -22,7 +22,7 @@
 /*
  *  cache.c - A simple cache for file systems meta-data.
  *
- *  Copyright (c) 2000 Apple Computer, Inc.
+ *  Copyright (c) 2000 - 2003 Apple Computer, Inc.
  *
  *  DRI: Josh de Cesare
  */
@@ -37,7 +37,7 @@ struct CacheEntry {
 };
 typedef struct CacheEntry CacheEntry;
 
-#define kCacheSize            (0x80000)
+#define kCacheSize            (kFSCacheSize)
 #define kCacheMinBlockSize    (0x200)
 #define kCacheMaxBlockSize    (0x4000)
 #define kCacheMaxEntries      (kCacheSize / kCacheMinBlockSize)
@@ -47,7 +47,7 @@ static long       gCacheBlockSize;
 static long       gCacheNumEntries;
 static long       gCacheTime;
 static CacheEntry gCacheEntries[kCacheMaxEntries];
-static char       gCacheBuffer[kCacheSize];
+static char       *gCacheBuffer = (char *)kFSCacheAddr;
 
 unsigned long     gCacheHits;
 unsigned long     gCacheMisses;
@@ -76,7 +76,7 @@ void CacheInit(CICell ih, long blockSize)
 long CacheRead(CICell ih, char *buffer, long long offset,
               long length, long cache)
 {
-  long       cnt, oldestEntry, oldestTime, loadCache = 0;
+  long       cnt, oldestEntry = 0, oldestTime, loadCache = 0;
   CacheEntry *entry;
   
   // See if the data can be cached.