gem5  v20.1.0.0
Classes | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Attributes | List of all members
EmulationPageTable Class Reference

#include <page_table.hh>

Inheritance diagram for EmulationPageTable:
Serializable MultiLevelPageTable< EntryTypes >

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 Entrylookup (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, 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 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)
 

Detailed Description

Definition at line 48 of file page_table.hh.

Member Typedef Documentation

◆ PTable

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

Definition at line 61 of file page_table.hh.

◆ PTableItr

typedef PTable::iterator EmulationPageTable::PTableItr
protected

Definition at line 62 of file page_table.hh.

Member Enumeration Documentation

◆ MappingFlags

Enumerator
Clobber 
Uncacheable 
ReadOnly 

Definition at line 91 of file page_table.hh.

Constructor & Destructor Documentation

◆ EmulationPageTable()

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

Definition at line 73 of file page_table.hh.

References isPowerOf2(), and pageSize.

◆ ~EmulationPageTable()

virtual EmulationPageTable::~EmulationPageTable ( )
inlinevirtual

Definition at line 83 of file page_table.hh.

Member Function Documentation

◆ getMappings()

void EmulationPageTable::getMappings ( std::vector< std::pair< Addr, Addr >> *  addr_mappings)

Definition at line 94 of file page_table.cc.

References pTable.

Referenced by Process::clone().

◆ initState()

virtual void EmulationPageTable::initState ( )
inlinevirtual

Reimplemented in MultiLevelPageTable< EntryTypes >.

Definition at line 100 of file page_table.hh.

Referenced by Process::initState().

◆ isUnmapped()

bool 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 117 of file page_table.cc.

References ArmISA::offset, pageOffset(), pageSize, pTable, and MipsISA::vaddr.

Referenced by MemState::remapRegion(), and MemState::unmapRegion().

◆ lookup()

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

◆ map()

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

◆ name()

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

Definition at line 103 of file page_table.hh.

References _name.

◆ pageAlign()

Addr EmulationPageTable::pageAlign ( Addr  a)
inline

Definition at line 105 of file page_table.hh.

References ArmISA::a, and offsetMask.

Referenced by lookup(), and translate().

◆ pageOffset()

Addr EmulationPageTable::pageOffset ( Addr  a)
inline

◆ pid()

uint64_t EmulationPageTable::pid ( ) const
inline

Definition at line 81 of file page_table.hh.

References _pid.

◆ remap()

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

◆ serialize()

void EmulationPageTable::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

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

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

◆ translate() [1/3]

bool EmulationPageTable::translate ( Addr  vaddr)
inline

Simplified translate function (just check for translation)

Parameters
vaddrThe virtual address.
Returns
True if translation exists

Definition at line 148 of file page_table.hh.

References translate(), and MipsISA::vaddr.

Referenced by translate().

◆ translate() [2/3]

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

Translate function.

Parameters
vaddrThe virtual address.
paddrPhysical address from translation.
Returns
True if translation exists

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

◆ translate() [3/3]

Fault 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 153 of file page_table.cc.

References NoFault, pageAlign(), pageSize, panic, and translate().

◆ unmap()

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

◆ unserialize()

void EmulationPageTable::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

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

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

Member Data Documentation

◆ _name

const std::string EmulationPageTable::_name
protected

Definition at line 69 of file page_table.hh.

Referenced by name().

◆ _pid

const uint64_t EmulationPageTable::_pid
protected

Definition at line 68 of file page_table.hh.

Referenced by pid().

◆ offsetMask

const Addr EmulationPageTable::offsetMask
protected

Definition at line 66 of file page_table.hh.

Referenced by pageAlign(), and pageOffset().

◆ pageSize

const Addr EmulationPageTable::pageSize
protected

◆ pTable

PTable EmulationPageTable::pTable
protected

Definition at line 63 of file page_table.hh.

Referenced by getMappings(), isUnmapped(), lookup(), map(), remap(), serialize(), unmap(), and unserialize().

◆ shared

bool EmulationPageTable::shared

Definition at line 98 of file page_table.hh.

Referenced by MultiLevelPageTable< EntryTypes >::initState().


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

Generated on Wed Sep 30 2020 14:02:24 for gem5 by doxygen 1.8.17