gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Types | Private Attributes | List of all members
FuncPageTable Class Reference

Declaration of functional page table. More...

#include <page_table.hh>

Inheritance diagram for FuncPageTable:
PageTableBase Serializable NoArchPageTable

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
 

Detailed Description

Declaration of functional page table.

Definition at line 205 of file page_table.hh.

Member Typedef Documentation

typedef std::unordered_map<Addr, TheISA::TlbEntry> FuncPageTable::PTable
private

Definition at line 208 of file page_table.hh.

typedef PTable::iterator FuncPageTable::PTableItr
private

Definition at line 209 of file page_table.hh.

Constructor & Destructor Documentation

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.

Member Function Documentation

void FuncPageTable::getMappings ( std::vector< std::pair< Addr, Addr >> *  addr_maps)
overridevirtual

Reimplemented from PageTableBase.

Definition at line 107 of file page_table.cc.

References pTable.

void FuncPageTable::initState ( ThreadContext tc)
inlineoverridevirtual

Implements PageTableBase.

Definition at line 219 of file page_table.hh.

bool FuncPageTable::isUnmapped ( Addr  vaddr,
int64_t  size 
)
overridevirtual

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.

Implements PageTableBase.

Definition at line 129 of file page_table.cc.

References PageTableBase::pageOffset(), PageTableBase::pageSize, and pTable.

bool FuncPageTable::lookup ( Addr  vaddr,
TheISA::TlbEntry &  entry 
)
overridevirtual

Lookup function.

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

Implements PageTableBase.

Definition at line 144 of file page_table.cc.

References PageTableBase::cacheElement::entry, PageTableBase::pageAlign(), pTable, PageTableBase::pTableCache, and PageTableBase::updateCache().

void FuncPageTable::map ( Addr  vaddr,
Addr  paddr,
int64_t  size,
uint64_t  flags = 0 
)
overridevirtual

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.

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.

void FuncPageTable::remap ( Addr  vaddr,
int64_t  size,
Addr  new_vaddr 
)
overridevirtual
void FuncPageTable::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 203 of file page_table.cc.

References X86ISA::count, csprintf(), paramOut(), and pTable.

void FuncPageTable::unmap ( Addr  vaddr,
int64_t  size 
)
overridevirtual
void FuncPageTable::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 218 of file page_table.cc.

References X86ISA::count, csprintf(), ArmISA::i, paramIn(), pTable, X86ISA::TlbEntry(), and MipsISA::vaddr.

Member Data Documentation

PTable FuncPageTable::pTable
private

Definition at line 210 of file page_table.hh.

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


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

Generated on Fri Jun 9 2017 13:04:10 for gem5 by doxygen 1.8.6