gem5
|
Declaration of functional page table. More...
#include <page_table.hh>
Public Member Functions | |
FuncPageTable (const std::string &__name, uint64_t _pid, Addr _pageSize=TheISA::PageBytes) | |
~FuncPageTable () | |
void | initState (ThreadContext *tc) override |
void | map (Addr vaddr, Addr paddr, int64_t size, uint64_t flags=0) override |
Maps a virtual memory region to a physical memory region. More... | |
void | remap (Addr vaddr, int64_t size, Addr new_vaddr) override |
void | unmap (Addr vaddr, int64_t size) override |
bool | isUnmapped (Addr vaddr, int64_t size) override |
Check if any pages in a region are already allocated. More... | |
bool | lookup (Addr vaddr, TheISA::TlbEntry &entry) override |
Lookup function. More... | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
void | getMappings (std::vector< std::pair< Addr, Addr >> *addr_maps) override |
Public Member Functions inherited from PageTableBase | |
PageTableBase (const std::string &__name, uint64_t _pid, Addr _pageSize=TheISA::PageBytes) | |
virtual | ~PageTableBase () |
const std::string | name () const |
Addr | pageAlign (Addr a) |
Addr | pageOffset (Addr a) |
bool | translate (Addr vaddr, Addr &paddr) |
Translate function. More... | |
bool | translate (Addr vaddr) |
Simplified translate function (just check for translation) More... | |
Fault | translate (RequestPtr req) |
Perform a translation on the memory request, fills in paddr field of req. More... | |
void | updateCache (Addr vaddr, TheISA::TlbEntry entry) |
Update the page table cache. More... | |
void | eraseCacheEntry (Addr vaddr) |
Erase an entry from the page table cache. More... | |
Public Member Functions inherited from Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. More... | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. More... | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Private Types | |
typedef std::unordered_map < Addr, TheISA::TlbEntry > | PTable |
typedef PTable::iterator | PTableItr |
Private Attributes | |
PTable | pTable |
Additional Inherited Members | |
Public Types inherited from PageTableBase | |
enum | MappingFlags : uint32_t { Zero = 0, Clobber = 1, NotPresent = 2, Uncacheable = 4, ReadOnly = 8 } |
Static Public Member Functions inherited from Serializable | |
static const std::string & | currentSection () |
Get the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
static void | unserializeGlobals (CheckpointIn &cp) |
Static Public Attributes inherited from Serializable | |
static int | ckptCount = 0 |
static int | ckptMaxCount = 0 |
static int | ckptPrevCount = -1 |
Protected Attributes inherited from PageTableBase | |
struct cacheElement | pTableCache [3] |
const Addr | pageSize |
const Addr | offsetMask |
const uint64_t | pid |
const std::string | _name |
Declaration of functional page table.
Definition at line 205 of file page_table.hh.
|
private |
Definition at line 208 of file page_table.hh.
|
private |
Definition at line 209 of file page_table.hh.
FuncPageTable::FuncPageTable | ( | const std::string & | __name, |
uint64_t | _pid, | ||
Addr | _pageSize = TheISA::PageBytes |
||
) |
Definition at line 51 of file page_table.cc.
FuncPageTable::~FuncPageTable | ( | ) |
Definition at line 57 of file page_table.cc.
|
overridevirtual |
|
inlineoverridevirtual |
Implements PageTableBase.
Definition at line 219 of file page_table.hh.
|
overridevirtual |
Check if any pages in a region are already allocated.
vaddr | The starting virtual address of the region. |
size | The length of the region. |
Implements PageTableBase.
Definition at line 129 of file page_table.cc.
References PageTableBase::pageOffset(), PageTableBase::pageSize, and pTable.
|
overridevirtual |
Lookup function.
vaddr | The virtual address. |
Implements PageTableBase.
Definition at line 144 of file page_table.cc.
References PageTableBase::cacheElement::entry, PageTableBase::pageAlign(), pTable, PageTableBase::pTableCache, and PageTableBase::updateCache().
|
overridevirtual |
Maps a virtual memory region to a physical memory region.
vaddr | The starting virtual address of the region. |
paddr | The starting physical address where the region is mapped. |
size | The length of the region. |
flags | Generic mapping flags that can be set by or-ing values from MappingFlags enum. |
Implements PageTableBase.
Definition at line 62 of file page_table.cc.
References PageTableBase::Clobber, DPRINTF, PageTableBase::eraseCacheEntry(), fatal, PageTableBase::pageOffset(), PageTableBase::pageSize, PageTableBase::pid, pTable, PageTableBase::ReadOnly, X86ISA::TlbEntry(), PageTableBase::Uncacheable, PageTableBase::updateCache(), and MipsISA::vaddr.
Implements PageTableBase.
Definition at line 85 of file page_table.cc.
References DPRINTF, PageTableBase::eraseCacheEntry(), PageTableBase::pageOffset(), PageTableBase::pageSize, pTable, PageTableBase::updateCache(), and MipsISA::vaddr.
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
cp | Checkpoint state |
Implements Serializable.
Definition at line 203 of file page_table.cc.
References X86ISA::count, csprintf(), paramOut(), and pTable.
|
overridevirtual |
Implements PageTableBase.
Definition at line 114 of file page_table.cc.
References DPRINTF, PageTableBase::eraseCacheEntry(), PageTableBase::pageOffset(), PageTableBase::pageSize, and pTable.
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
cp | Checkpoint state |
Implements Serializable.
Definition at line 218 of file page_table.cc.
References X86ISA::count, csprintf(), ArmISA::i, paramIn(), pTable, X86ISA::TlbEntry(), and MipsISA::vaddr.
|
private |
Definition at line 210 of file page_table.hh.
Referenced by getMappings(), isUnmapped(), lookup(), map(), remap(), serialize(), unmap(), and unserialize().