NOVA User-Level Environment
Version testbox/changed-memory-timing-317-g320d8b5
|
A cache for physical memory indexed by page number. More...
#include <memcache.h>
Classes | |
struct | Buffers |
Cache MMIO registers and pending writes to them. More... | |
struct | CacheEntry |
Public Types | |
enum | Type { TYPE_R = 1u << 0, TYPE_W = 1u << 1, TYPE_RMW = TYPE_R | TYPE_W, TYPE_U = 1u << 2, TYPE_RES = 1u << 3, TYPE_X = 1u << 4 } |
Public Member Functions | |
CacheEntry * | get (unsigned long phys1, unsigned long phys2, unsigned len, Type type) |
Get an entry from the cache or fetch one from memory. | |
void | invalidate (bool writeback) |
Invalidate the cache, thus writeback the buffers. | |
MemCache (DBus< MessageMem > &mem, DBus< MessageMemRegion > &memregion) |
Public Attributes | |
bool | debug |
CacheEntry | _values [ASSOZ] |
unsigned | _newest |
Protected Attributes | |
DBus< MessageMem > & | _mem |
DBus< MessageMemRegion > & | _memregion |
unsigned | _fault |
unsigned | _error_code |
unsigned | _debug_fault_line |
unsigned | _mtr_in |
unsigned | _mtr_read |
unsigned | _mtr_out |
Private Types | |
enum | { SIZE = 64, ASSOZ = 6, BUFFERS = 6, BUFFER_SIZE = 16 + 4 } |
Private Member Functions | |
unsigned | slot (unsigned phys) |
void | buffer_io (bool read, unsigned index) |
void | invalidate_dirty () |
Invalidate the oldest dirty entry in the list. |
Private Attributes | |
struct { | |
CacheEntry _values [ASSOZ] | |
unsigned _newest | |
} | _sets [SIZE] |
MemCache::Buffers | _buffers [BUFFERS] |
unsigned | _newest_buffer |
unsigned | _oldest_write |
unsigned | _newest_write |
A cache for physical memory indexed by page number.
enum MemCache::Type |
|
inline |
|
inlineprivate |
|
inline |
Get an entry from the cache or fetch one from memory.
What should we do if two different pages are referenced?
We could fallback to dword mode but there is this strange corner case where somebody does an locked operation crossing two non-adjunct pages, where we have to map the two pages into an 8k region and unmap them later on....
Invalidate a dirty entry, as we entry points to the last used buffer it must be the oldest write.
|
inline |
Invalidate the cache, thus writeback the buffers.
|
inlineprivate |
Invalidate the oldest dirty entry in the list.
|
inlineprivate |
|
private |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
unsigned MemCache::_newest |
|
private |
|
private |
|
private |
struct { ... } MemCache::_sets[SIZE] |
CacheEntry MemCache::_values[ASSOZ] |
bool MemCache::debug |