gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::EmulationPageTable Class Reference

#include <page_table.hh>

Inheritance diagram for gem5::EmulationPageTable:
gem5::Serializable gem5::MultiLevelPageTable< EntryTypes >

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 Entrylookup (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, EntryPTable
 
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.
 

Detailed Description

Definition at line 53 of file page_table.hh.

Member Typedef Documentation

◆ PTable

typedef std::unordered_map<Addr, Entry> gem5::EmulationPageTable::PTable
protected

Definition at line 66 of file page_table.hh.

◆ PTableItr

typedef PTable::iterator gem5::EmulationPageTable::PTableItr
protected

Definition at line 67 of file page_table.hh.

Member Enumeration Documentation

◆ MappingFlags

Enumerator
Clobber 
Uncacheable 
ReadOnly 

Definition at line 96 of file page_table.hh.

Constructor & Destructor Documentation

◆ EmulationPageTable()

gem5::EmulationPageTable::EmulationPageTable ( const std::string & __name,
uint64_t _pid,
Addr _pageSize )
inline

Definition at line 78 of file page_table.hh.

References _pageSize, and gem5::isPowerOf2().

◆ ~EmulationPageTable()

virtual gem5::EmulationPageTable::~EmulationPageTable ( )
inlinevirtual

Definition at line 88 of file page_table.hh.

Member Function Documentation

◆ externalize()

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().

◆ getMappings()

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().

◆ initState()

virtual void gem5::EmulationPageTable::initState ( )
inlinevirtual

Reimplemented in gem5::MultiLevelPageTable< EntryTypes >.

Definition at line 106 of file page_table.hh.

Referenced by gem5::doClone(), and gem5::Process::initState().

◆ isUnmapped()

bool gem5::EmulationPageTable::isUnmapped ( Addr vaddr,
int64_t size )
virtual

Check if any pages in a region are already allocated.

Parameters
vaddrThe starting virtual address of the region.
sizeThe length of the region.
Returns
True if no pages in the region are mapped.

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().

◆ lookup()

const EmulationPageTable::Entry * gem5::EmulationPageTable::lookup ( Addr vaddr)

Lookup function.

Parameters
vaddrThe virtual address.
Returns
The page table entry corresponding to vaddr.

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().

◆ map()

void gem5::EmulationPageTable::map ( Addr vaddr,
Addr paddr,
int64_t size,
uint64_t flags = 0 )
virtual

Maps a virtual memory region to a physical memory region.

Parameters
vaddrThe starting virtual address of the region.
paddrThe starting physical address where the region is mapped.
sizeThe length of the region.
flagsGeneric 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().

◆ name()

const std::string gem5::EmulationPageTable::name ( ) const
inline

Definition at line 109 of file page_table.hh.

References _name.

◆ pageAlign()

Addr gem5::EmulationPageTable::pageAlign ( Addr a)
inline

Definition at line 111 of file page_table.hh.

References gem5::ArmISA::a, and offsetMask.

Referenced by lookup(), and translate().

◆ pageOffset()

Addr gem5::EmulationPageTable::pageOffset ( Addr a)
inline

Definition at line 112 of file page_table.hh.

References gem5::ArmISA::a, and offsetMask.

Referenced by isUnmapped(), map(), remap(), translate(), and unmap().

◆ pageSize()

◆ pid()

uint64_t gem5::EmulationPageTable::pid ( ) const
inline

Definition at line 86 of file page_table.hh.

References _pid.

Referenced by gem5::X86ISA::X86_64Process::initState().

◆ remap()

void gem5::EmulationPageTable::remap ( Addr vaddr,
int64_t size,
Addr new_vaddr )
virtual

◆ serialize()

void gem5::EmulationPageTable::serialize ( CheckpointOut & cp) const
overridevirtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint 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().

◆ translate() [1/3]

bool gem5::EmulationPageTable::translate ( Addr vaddr)
inline

Simplified translate function (just check for translation)

Parameters
vaddrThe virtual address.
Returns
True if translation exists

Definition at line 158 of file page_table.hh.

References translate(), and gem5::MipsISA::vaddr.

◆ translate() [2/3]

bool gem5::EmulationPageTable::translate ( Addr vaddr,
Addr & paddr )

◆ translate() [3/3]

Fault gem5::EmulationPageTable::translate ( const RequestPtr & req)

Perform a translation on the memory request, fills in paddr field of req.

Parameters
reqThe memory request.

Definition at line 156 of file page_table.cc.

References _pageSize, gem5::NoFault, pageAlign(), panic, and translate().

◆ translateRange()

TranslationGenPtr gem5::EmulationPageTable::translateRange ( Addr vaddr,
Addr size )
inline

Definition at line 178 of file page_table.hh.

References gem5::MipsISA::vaddr.

◆ unmap()

void gem5::EmulationPageTable::unmap ( Addr vaddr,
int64_t size )
virtual

◆ unserialize()

void gem5::EmulationPageTable::unserialize ( CheckpointIn & cp)
overridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint 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().

Member Data Documentation

◆ _name

const std::string gem5::EmulationPageTable::_name
protected

Definition at line 74 of file page_table.hh.

Referenced by name().

◆ _pageSize

◆ _pid

const uint64_t gem5::EmulationPageTable::_pid
protected

Definition at line 73 of file page_table.hh.

Referenced by pid().

◆ offsetMask

const Addr gem5::EmulationPageTable::offsetMask
protected

Definition at line 71 of file page_table.hh.

Referenced by pageAlign(), and pageOffset().

◆ pTable

PTable gem5::EmulationPageTable::pTable
protected

◆ shared

bool gem5::EmulationPageTable::shared

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

Generated on Tue Jun 18 2024 16:24:11 for gem5 by doxygen 1.11.0