?? hdcache.h
字號:
/* some basic structures for ATAPI caching used in hdcache.c */
#ifndef _HDCACHE_H_
#define _HDCACHE_H_
#include "ide.h"
#include "errorcodes.h"
#define WRITE_THROUGH_CACHE 0x1
#define WRITE_BACK_CACHE 0x2
typedef struct CACHE_PAGE {
Boolean dirty;
Uint16 counter; /* Gives the validity of the page and a counter for replacement algorithm */
Uint32 sector;
Boolean empty;
} cachePageData;
typedef struct CACHING_SYSTEM {
Uint8 cache_type;
Uint16 nbPages;
cachePageData *pages;
Uint8 *data;
} cachingSystem;
/* =========== File HDCACHE.C ================ */
Int32 initCache(cachingSystem *cache, Uint8 type, Uint16 nbPages); //
void closeCache(cachingSystem *cache); //
Int32 readFromCache(cachingSystem *cache, Uint32 blocknb, Uint8 *buf); //
Int32 loadToCache(cachingSystem *cache, Uint32 blocknb, Uint8 *buf); //
Int32 writeToCache(cachingSystem *cache, Uint32 blocknb, Uint8 *buf); //
Int32 bulkLoadToCache(cachingSystem *cache, Uint32 blocknb, Uint32 blockCount, Uint8 **buf);
Uint32 getCacheSize(cachingSystem *cache);
void invalidateCache(cachingSystem *cache, Uint32 blocknb);
void updateCache(cachingSystem *cache, Uint32 blocknb, Uint8 *buf); //
Uint16 flushLRU(cachingSystem *cache, Uint8 *buf, Uint32 *sector); //
void updatePageCounter(cachingSystem *cache, Int32 page); //
void incrementCounters(cachingSystem *cache, Uint16 max); //
Int32 leastRecentlyUsed(cachingSystem *cache); //
Int32 leastRecentlyUsedDirty(cachingSystem *cache); //
Int32 freeOrLeastRecentlyUsedNotDirty(cachingSystem *cache); //
Int32 findSector(cachingSystem *cache, Uint32 sector); //
void reportCache(cachingSystem *cache); //
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -