gem5 v24.0.0.0
|
#include <page_table.hh>
Classes | |
struct | Entry |
class | PageTableTranslationGen |
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) |
Addr | pageSize () |
virtual void | map (Addr vaddr, Addr paddr, int64_t size, uint64_t flags=0) |
Maps a virtual memory region to a physical memory region. | |
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. | |
const Entry * | lookup (Addr vaddr) |
Lookup function. | |
bool | translate (Addr vaddr, Addr &paddr) |
Translate function. | |
bool | translate (Addr vaddr) |
Simplified translate function (just check for translation) | |
TranslationGenPtr | translateRange (Addr vaddr, Addr size) |
Fault | translate (const RequestPtr &req) |
Perform a translation on the memory request, fills in paddr field of req. | |
const std::string | externalize () const |
Dump all items in the pTable, to a concatenation of strings of the form Addr:Entry;. | |
void | getMappings (std::vector< std::pair< Addr, Addr > > *addr_mappings) |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. | |
Public Member Functions inherited from gem5::Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. | |
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 gem5::Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. | |
static void | generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream) |
Generate a checkpoint file so that the serialization can be routed to it. | |
Definition at line 53 of file page_table.hh.
|
protected |
Definition at line 66 of file page_table.hh.
|
protected |
Definition at line 67 of file page_table.hh.
enum gem5::EmulationPageTable::MappingFlags : uint32_t |
Enumerator | |
---|---|
Clobber | |
Uncacheable | |
ReadOnly |
Definition at line 96 of file page_table.hh.
|
inline |
Definition at line 78 of file page_table.hh.
References _pageSize, and gem5::isPowerOf2().
|
inlinevirtual |
Definition at line 88 of file page_table.hh.
const std::string gem5::EmulationPageTable::externalize | ( | ) | const |
Dump all items in the pTable, to a concatenation of strings of the form Addr:Entry;.
Definition at line 224 of file page_table.cc.
References pTable, and gem5::ArmISA::ss.
Referenced by gem5::BaseRemoteGDB::cmdDumpPageTable().
void gem5::EmulationPageTable::getMappings | ( | std::vector< std::pair< Addr, Addr > > * | addr_mappings | ) |
Definition at line 97 of file page_table.cc.
References pTable.
Referenced by gem5::Process::clone().
|
inlinevirtual |
Reimplemented in gem5::MultiLevelPageTable< EntryTypes >.
Definition at line 106 of file page_table.hh.
Referenced by gem5::doClone(), and gem5::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 120 of file page_table.cc.
References _pageSize, gem5::ArmISA::offset, pageOffset(), pTable, and gem5::MipsISA::vaddr.
Referenced by gem5::MemState::remapRegion(), and gem5::MemState::unmapRegion().
const EmulationPageTable::Entry * gem5::EmulationPageTable::lookup | ( | Addr | vaddr | ) |
Lookup function.
vaddr | The virtual address. |
Definition at line 133 of file page_table.cc.
References pageAlign(), pTable, and gem5::MipsISA::vaddr.
Referenced by gem5::ArmISA::RemoteGDB::acc(), gem5::Process::allocateMem(), gem5::MemState::isUnmapped(), and translate().
|
virtual |
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 gem5::MultiLevelPageTable< EntryTypes >.
Definition at line 48 of file page_table.cc.
References _pageSize, Clobber, DPRINTF, flags, pageOffset(), panic_if, pTable, and gem5::MipsISA::vaddr.
Referenced by gem5::Process::allocateMem(), gem5::X86ISA::X86_64Process::initState(), gem5::MultiLevelPageTable< EntryTypes >::map(), gem5::Process::map(), and gem5::Process::replicatePage().
|
inline |
Definition at line 109 of file page_table.hh.
References _name.
Definition at line 111 of file page_table.hh.
References gem5::ArmISA::a, and offsetMask.
Referenced by lookup(), and translate().
Definition at line 112 of file page_table.hh.
References gem5::ArmISA::a, and offsetMask.
Referenced by isUnmapped(), map(), remap(), translate(), and unmap().
|
inline |
Definition at line 115 of file page_table.hh.
References _pageSize.
Referenced by gem5::Process::allocateMem(), gem5::getpagesizeFunc(), gem5::mmap2Func(), gem5::mmapFunc(), gem5::mremapFunc(), gem5::Process::replicatePage(), gem5::EmulationPageTable::PageTableTranslationGen::translate(), and gem5::Process::updateBias().
|
inline |
Definition at line 86 of file page_table.hh.
References _pid.
Referenced by gem5::X86ISA::X86_64Process::initState().
Reimplemented in gem5::MultiLevelPageTable< EntryTypes >.
Definition at line 75 of file page_table.cc.
References _pageSize, DPRINTF, pageOffset(), pTable, and gem5::MipsISA::vaddr.
Referenced by gem5::MultiLevelPageTable< EntryTypes >::remap(), and gem5::MemState::remapRegion().
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
cp | Checkpoint state |
Implements gem5::Serializable.
Reimplemented in gem5::MultiLevelPageTable< EntryTypes >.
Definition at line 186 of file page_table.cc.
References gem5::X86ISA::count, gem5::csprintf(), gem5::paramOut(), and pTable.
Referenced by gem5::MultiLevelPageTable< EntryTypes >::serialize(), and gem5::Process::serialize().
|
inline |
Simplified translate function (just check for translation)
vaddr | The virtual address. |
Definition at line 158 of file page_table.hh.
References translate(), and gem5::MipsISA::vaddr.
Translate function.
vaddr | The virtual address. |
paddr | Physical address from translation. |
Definition at line 143 of file page_table.cc.
References DPRINTF, lookup(), gem5::EmulationPageTable::Entry::paddr, pageOffset(), and gem5::MipsISA::vaddr.
Referenced by gem5::Process::clone(), gem5::EmulationPageTable::PageTableTranslationGen::translate(), translate(), translate(), gem5::SparcISA::TLB::translateData(), gem5::SparcISA::TLB::translateFunctional(), gem5::X86ISA::TLB::translateFunctional(), and gem5::SparcISA::TLB::translateInst().
Fault gem5::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 156 of file page_table.cc.
References _pageSize, gem5::NoFault, pageAlign(), panic, and translate().
|
inline |
Definition at line 178 of file page_table.hh.
References gem5::MipsISA::vaddr.
|
virtual |
Reimplemented in gem5::MultiLevelPageTable< EntryTypes >.
Definition at line 104 of file page_table.cc.
References _pageSize, DPRINTF, pageOffset(), pTable, and gem5::MipsISA::vaddr.
Referenced by gem5::MultiLevelPageTable< EntryTypes >::unmap(), and gem5::MemState::unmapRegion().
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
cp | Checkpoint state |
Implements gem5::Serializable.
Reimplemented in gem5::MultiLevelPageTable< EntryTypes >.
Definition at line 203 of file page_table.cc.
References gem5::X86ISA::count, gem5::csprintf(), flags, gem5::ArmISA::i, gem5::paramIn(), pTable, UNSERIALIZE_SCALAR, and gem5::MipsISA::vaddr.
Referenced by gem5::MultiLevelPageTable< EntryTypes >::unserialize(), and gem5::Process::unserialize().
|
protected |
Definition at line 74 of file page_table.hh.
Referenced by name().
|
protected |
Definition at line 70 of file page_table.hh.
Referenced by EmulationPageTable(), gem5::MultiLevelPageTable< EntryTypes >::initState(), isUnmapped(), map(), gem5::MultiLevelPageTable< EntryTypes >::map(), pageSize(), remap(), gem5::MultiLevelPageTable< EntryTypes >::remap(), translate(), unmap(), and gem5::MultiLevelPageTable< EntryTypes >::unmap().
|
protected |
Definition at line 73 of file page_table.hh.
Referenced by pid().
|
protected |
Definition at line 71 of file page_table.hh.
Referenced by pageAlign(), and pageOffset().
|
protected |
Definition at line 68 of file page_table.hh.
Referenced by externalize(), getMappings(), isUnmapped(), lookup(), map(), remap(), serialize(), unmap(), and unserialize().
bool gem5::EmulationPageTable::shared |
Definition at line 104 of file page_table.hh.
Referenced by gem5::doClone(), and gem5::MultiLevelPageTable< EntryTypes >::initState().