NOVA User-Level Environment  Version testbox/changed-memory-timing-317-g320d8b5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MemTlb Class Reference

A TLB implementation relying on the cache. More...

#include <memtlb.h>

Inheritance diagram for MemTlb:
MemCache InstructionCache Halifax

Protected Member Functions

Type user_access (Type type)
int init ()
int read_code (unsigned long virt, unsigned len, void *buffer)
 Read the len instruction-bytes at the given address into a buffer.
int prepare_virtual (unsigned virt, unsigned len, Type type, void *&ptr)
 MemTlb (DBus< MessageMem > &mem, DBus< MessageMemRegion > &memregion)

Protected Attributes

CpuState_cpu
- Protected Attributes inherited from MemCache
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  Features {
  FEATURE_PSE = 1 << 0, FEATURE_PSE36 = 1 << 1, FEATURE_PAE = 1 << 2, FEATURE_SMALL_PDPT = 1 << 3,
  FEATURE_LONG = 1 << 4
}

Private Member Functions

template<unsigned features, typename PTE_TYPE >
unsigned tlb_fill2 (unsigned long virt, unsigned type, long unsigned &phys)
int virt_to_phys (unsigned long virt, Type type, long unsigned &phys)
CacheEntryfind_virtual (unsigned virt, unsigned len, Type type)
 Find a CacheEntry to a virtual memory access.

Static Private Member Functions

template<unsigned features, typename PTE_TYPE >
static unsigned tlb_fill (MemTlb *tlb, unsigned long virt, unsigned type, long unsigned &phys)

Private Attributes

unsigned long long _pdpt [4]
unsigned long _msr_efer
unsigned _paging_mode
unsigned(* tlb_fill_func )(MemTlb *tlb, unsigned long virt, unsigned type, long unsigned &phys)

Additional Inherited Members

- Public Types inherited from MemCache
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 inherited from MemCache
CacheEntryget (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 inherited from MemCache
bool debug

Detailed Description

A TLB implementation relying on the cache.

Member Enumeration Documentation

enum MemTlb::Features
private
Enumerator:
FEATURE_PSE 
FEATURE_PSE36 
FEATURE_PAE 
FEATURE_SMALL_PDPT 
FEATURE_LONG 

Constructor & Destructor Documentation

MemTlb::MemTlb ( DBus< MessageMem > &  mem,
DBus< MessageMemRegion > &  memregion 
)
inlineprotected

Member Function Documentation

CacheEntry* MemTlb::find_virtual ( unsigned  virt,
unsigned  len,
Type  type 
)
inlineprivate

Find a CacheEntry to a virtual memory access.

int MemTlb::init ( )
inlineprotected
int MemTlb::prepare_virtual ( unsigned  virt,
unsigned  len,
Type  type,
void *&  ptr 
)
inlineprotected
int MemTlb::read_code ( unsigned long  virt,
unsigned  len,
void *  buffer 
)
inlineprotected

Read the len instruction-bytes at the given address into a buffer.

template<unsigned features, typename PTE_TYPE >
static unsigned MemTlb::tlb_fill ( MemTlb tlb,
unsigned long  virt,
unsigned  type,
long unsigned &  phys 
)
inlinestaticprivate
template<unsigned features, typename PTE_TYPE >
unsigned MemTlb::tlb_fill2 ( unsigned long  virt,
unsigned  type,
long unsigned &  phys 
)
inlineprivate
Type MemTlb::user_access ( Type  type)
inlineprotected
int MemTlb::virt_to_phys ( unsigned long  virt,
Type  type,
long unsigned &  phys 
)
inlineprivate

Member Data Documentation

CpuState* MemTlb::_cpu
protected
unsigned long MemTlb::_msr_efer
private
unsigned MemTlb::_paging_mode
private
unsigned long long MemTlb::_pdpt[4]
private
unsigned(* MemTlb::tlb_fill_func)(MemTlb *tlb, unsigned long virt, unsigned type, long unsigned &phys)
private

The documentation for this class was generated from the following file: