gem5
v20.1.0.0
|
#include <page_table.hh>
Classes | |
struct | Entry |
Public Types | |
enum | MappingFlags : uint32_t { Clobber = 1, Uncacheable = 4, ReadOnly = 8 } |
Public Member Functions | |
EmulationPageTable (const std::string &__name, uint64_t _pid, Addr _pageSize) | |
uint64_t | pid () const |
virtual | ~EmulationPageTable () |
virtual void | initState () |
const std::string | name () const |
Addr | pageAlign (Addr a) |
Addr | pageOffset (Addr a) |
virtual void | map (Addr vaddr, Addr paddr, int64_t size, uint64_t flags=0) |
Maps a virtual memory region to a physical memory region. More... | |
virtual void | remap (Addr vaddr, int64_t size, Addr new_vaddr) |
virtual void | unmap (Addr vaddr, int64_t size) |
virtual bool | isUnmapped (Addr vaddr, int64_t size) |
Check if any pages in a region are already allocated. More... | |
const Entry * | lookup (Addr vaddr) |
Lookup function. More... | |
bool | translate (Addr vaddr, Addr &paddr) |
Translate function. More... | |
bool | translate (Addr vaddr) |
Simplified translate function (just check for translation) More... | |
Fault | translate (const RequestPtr &req) |
Perform a translation on the memory request, fills in paddr field of req. More... | |
void | getMappings (std::vector< std::pair< Addr, Addr >> *addr_mappings) |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. 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) |
Public Attributes | |
bool | shared |
Protected Types | |
typedef std::unordered_map< Addr, Entry > | PTable |
typedef PTable::iterator | PTableItr |
Protected Attributes | |
PTable | pTable |
const Addr | pageSize |
const Addr | offsetMask |
const uint64_t | _pid |
const std::string | _name |
Additional Inherited Members | |
Static Public Member Functions inherited from Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
Serializes all the SimObjects. More... | |
static void | unserializeGlobals (CheckpointIn &cp) |
Definition at line 48 of file page_table.hh.
|
protected |
Definition at line 61 of file page_table.hh.
|
protected |
Definition at line 62 of file page_table.hh.
enum EmulationPageTable::MappingFlags : uint32_t |
Enumerator | |
---|---|
Clobber | |
Uncacheable | |
ReadOnly |
Definition at line 91 of file page_table.hh.
|
inline |
Definition at line 73 of file page_table.hh.
References isPowerOf2(), and pageSize.
|
inlinevirtual |
Definition at line 83 of file page_table.hh.
void EmulationPageTable::getMappings | ( | std::vector< std::pair< Addr, Addr >> * | addr_mappings | ) |
|
inlinevirtual |
Reimplemented in MultiLevelPageTable< EntryTypes >.
Definition at line 100 of file page_table.hh.
Referenced by Process::initState().
|
virtual |
Check if any pages in a region are already allocated.
vaddr | The starting virtual address of the region. |
size | The length of the region. |
Definition at line 117 of file page_table.cc.
References ArmISA::offset, pageOffset(), pageSize, pTable, and MipsISA::vaddr.
Referenced by MemState::remapRegion(), and MemState::unmapRegion().
const EmulationPageTable::Entry * EmulationPageTable::lookup | ( | Addr | vaddr | ) |
Lookup function.
vaddr | The virtual address. |
Definition at line 130 of file page_table.cc.
References pageAlign(), pTable, and MipsISA::vaddr.
Referenced by PowerISA::RemoteGDB::acc(), SparcISA::RemoteGDB::acc(), MipsISA::RemoteGDB::acc(), RiscvISA::RemoteGDB::acc(), X86ISA::RemoteGDB::acc(), ArmISA::RemoteGDB::acc(), MemState::isUnmapped(), translate(), RiscvISA::TLB::translateFunctional(), and X86ISA::TLB::translateFunctional().
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. |
Reimplemented in MultiLevelPageTable< EntryTypes >.
Definition at line 45 of file page_table.cc.
References Clobber, DPRINTF, pageOffset(), pageSize, panic_if, pTable, and MipsISA::vaddr.
Referenced by Process::allocateMem(), X86ISA::X86_64Process::initState(), Process::map(), MultiLevelPageTable< EntryTypes >::map(), and Process::replicatePage().
|
inline |
Definition at line 103 of file page_table.hh.
References _name.
Definition at line 105 of file page_table.hh.
References ArmISA::a, and offsetMask.
Referenced by lookup(), and translate().
Definition at line 106 of file page_table.hh.
References ArmISA::a, and offsetMask.
Referenced by isUnmapped(), map(), remap(), translate(), RiscvISA::TLB::translateFunctional(), X86ISA::TLB::translateFunctional(), and unmap().
|
inline |
Definition at line 81 of file page_table.hh.
References _pid.
Reimplemented in MultiLevelPageTable< EntryTypes >.
Definition at line 72 of file page_table.cc.
References DPRINTF, pageOffset(), pageSize, pTable, and MipsISA::vaddr.
Referenced by MultiLevelPageTable< EntryTypes >::remap(), and MemState::remapRegion().
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
cp | Checkpoint state |
Implements Serializable.
Definition at line 169 of file page_table.cc.
References X86ISA::count, csprintf(), paramOut(), and pTable.
Referenced by Process::serialize(), and MultiLevelPageTable< EntryTypes >::serialize().
|
inline |
Simplified translate function (just check for translation)
vaddr | The virtual address. |
Definition at line 148 of file page_table.hh.
References translate(), and MipsISA::vaddr.
Referenced by translate().
Translate function.
vaddr | The virtual address. |
paddr | Physical address from translation. |
Definition at line 140 of file page_table.cc.
References DPRINTF, lookup(), EmulationPageTable::Entry::paddr, pageOffset(), and MipsISA::vaddr.
Referenced by Process::clone(), translate(), MipsISA::TLB::translateAtomic(), PowerISA::TLB::translateData(), MipsISA::TLB::translateFunctional(), PowerISA::TLB::translateFunctional(), SparcISA::TLB::translateFunctional(), and PowerISA::TLB::translateInst().
Fault EmulationPageTable::translate | ( | const RequestPtr & | req | ) |
Perform a translation on the memory request, fills in paddr field of req.
req | The memory request. |
Definition at line 153 of file page_table.cc.
References NoFault, pageAlign(), pageSize, panic, and translate().
|
virtual |
Reimplemented in MultiLevelPageTable< EntryTypes >.
Definition at line 101 of file page_table.cc.
References DPRINTF, pageOffset(), pageSize, pTable, and MipsISA::vaddr.
Referenced by MultiLevelPageTable< EntryTypes >::unmap(), and MemState::unmapRegion().
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
cp | Checkpoint state |
Implements Serializable.
Definition at line 186 of file page_table.cc.
References X86ISA::count, csprintf(), ArmISA::i, paramIn(), pTable, UNSERIALIZE_SCALAR, and MipsISA::vaddr.
Referenced by Process::unserialize(), and MultiLevelPageTable< EntryTypes >::unserialize().
|
protected |
Definition at line 69 of file page_table.hh.
Referenced by name().
|
protected |
Definition at line 68 of file page_table.hh.
Referenced by pid().
|
protected |
Definition at line 66 of file page_table.hh.
Referenced by pageAlign(), and pageOffset().
|
protected |
Definition at line 65 of file page_table.hh.
Referenced by EmulationPageTable(), MultiLevelPageTable< EntryTypes >::initState(), isUnmapped(), map(), MultiLevelPageTable< EntryTypes >::map(), remap(), MultiLevelPageTable< EntryTypes >::remap(), translate(), unmap(), and MultiLevelPageTable< EntryTypes >::unmap().
|
protected |
Definition at line 63 of file page_table.hh.
Referenced by getMappings(), isUnmapped(), lookup(), map(), remap(), serialize(), unmap(), and unserialize().
bool EmulationPageTable::shared |
Definition at line 98 of file page_table.hh.
Referenced by MultiLevelPageTable< EntryTypes >::initState().