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

Declaration of base class for page table. More...

#include <page_table.hh>

Inheritance diagram for PageTableBase:
Serializable FuncPageTable MultiLevelPageTable< ISAOps > NoArchPageTable

Classes

struct  cacheElement
 

Public Types

enum  MappingFlags : uint32_t {
  Zero = 0, Clobber = 1, NotPresent = 2, Uncacheable = 4,
  ReadOnly = 8
}
 

Public Member Functions

 PageTableBase (const std::string &__name, uint64_t _pid, Addr _pageSize=TheISA::PageBytes)
 
virtual ~PageTableBase ()
 
virtual void initState (ThreadContext *tc)=0
 
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)=0
 Maps a virtual memory region to a physical memory region. More...
 
virtual void remap (Addr vaddr, int64_t size, Addr new_vaddr)=0
 
virtual void unmap (Addr vaddr, int64_t size)=0
 
virtual bool isUnmapped (Addr vaddr, int64_t size)=0
 Check if any pages in a region are already allocated. More...
 
virtual bool lookup (Addr vaddr, TheISA::TlbEntry &entry)=0
 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 (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...
 
virtual void getMappings (std::vector< std::pair< Addr, Addr >> *addr_mappings)
 
- Public Member Functions inherited from Serializable
 Serializable ()
 
virtual ~Serializable ()
 
virtual void serialize (CheckpointOut &cp) const =0
 Serialize an object. More...
 
virtual void unserialize (CheckpointIn &cp)=0
 Unserialize an object. More...
 
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)
 

Protected Attributes

struct cacheElement pTableCache [3]
 
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 ()
 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
 

Detailed Description

Declaration of base class for page table.

Definition at line 57 of file page_table.hh.

Member Enumeration Documentation

enum PageTableBase::MappingFlags : uint32_t
Enumerator
Zero 
Clobber 
NotPresent 
Uncacheable 
ReadOnly 

Definition at line 96 of file page_table.hh.

Constructor & Destructor Documentation

PageTableBase::PageTableBase ( const std::string &  __name,
uint64_t  _pid,
Addr  _pageSize = TheISA::PageBytes 
)
inline

Definition at line 76 of file page_table.hh.

References isPowerOf2(), pageSize, pTableCache, and PageTableBase::cacheElement::valid.

virtual PageTableBase::~PageTableBase ( )
inlinevirtual

Definition at line 87 of file page_table.hh.

Member Function Documentation

void PageTableBase::eraseCacheEntry ( Addr  vaddr)
inline

Erase an entry from the page table cache.

Parameters
vaddrvirtual address (page aligned) to check

Definition at line 186 of file page_table.hh.

References pTableCache, and PageTableBase::cacheElement::valid.

Referenced by FuncPageTable::map(), FuncPageTable::remap(), and FuncPageTable::unmap().

virtual void PageTableBase::getMappings ( std::vector< std::pair< Addr, Addr >> *  addr_mappings)
inlinevirtual

Reimplemented in FuncPageTable.

Definition at line 198 of file page_table.hh.

Referenced by Process::clone().

virtual void PageTableBase::initState ( ThreadContext tc)
pure virtual
virtual bool PageTableBase::isUnmapped ( Addr  vaddr,
int64_t  size 
)
pure 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.

Implemented in FuncPageTable, and MultiLevelPageTable< ISAOps >.

virtual bool PageTableBase::lookup ( Addr  vaddr,
TheISA::TlbEntry &  entry 
)
pure virtual
virtual void PageTableBase::map ( Addr  vaddr,
Addr  paddr,
int64_t  size,
uint64_t  flags = 0 
)
pure 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.

Implemented in FuncPageTable, and MultiLevelPageTable< ISAOps >.

Referenced by Process::allocateMem(), Process::map(), and Process::replicatePage().

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

Definition at line 107 of file page_table.hh.

References _name.

Addr PageTableBase::pageAlign ( Addr  a)
inline
Addr PageTableBase::pageOffset ( Addr  a)
inline
virtual void PageTableBase::remap ( Addr  vaddr,
int64_t  size,
Addr  new_vaddr 
)
pure virtual

Implemented in FuncPageTable, and MultiLevelPageTable< ISAOps >.

Referenced by mremapFunc().

bool PageTableBase::translate ( Addr  vaddr,
Addr paddr 
)
bool PageTableBase::translate ( Addr  vaddr)
inline

Simplified translate function (just check for translation)

Parameters
vaddrThe virtual address.
Returns
True if translation exists

Definition at line 153 of file page_table.hh.

References translate().

Referenced by translate().

Fault PageTableBase::translate ( RequestPtr  req)

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

Parameters
reqThe memory request.

Definition at line 186 of file page_table.cc.

References Request::getSize(), Request::getVaddr(), NoFault, pageAlign(), pageSize, panic, Request::setPaddr(), and translate().

virtual void PageTableBase::unmap ( Addr  vaddr,
int64_t  size 
)
pure virtual

Implemented in FuncPageTable, and MultiLevelPageTable< ISAOps >.

Referenced by mremapFunc().

void PageTableBase::updateCache ( Addr  vaddr,
TheISA::TlbEntry  entry 
)
inline

Update the page table cache.

Parameters
vaddrvirtual address (page aligned) to check
ptepage table entry to return

Definition at line 167 of file page_table.hh.

References PageTableBase::cacheElement::entry, pTableCache, PageTableBase::cacheElement::vaddr, MipsISA::vaddr, and PageTableBase::cacheElement::valid.

Referenced by FuncPageTable::lookup(), FuncPageTable::map(), and FuncPageTable::remap().

Member Data Documentation

const std::string PageTableBase::_name
protected

Definition at line 72 of file page_table.hh.

Referenced by name().

const Addr PageTableBase::offsetMask
protected

Definition at line 69 of file page_table.hh.

Referenced by pageAlign(), and pageOffset().

const Addr PageTableBase::pageSize
protected
const uint64_t PageTableBase::pid
protected

Definition at line 71 of file page_table.hh.

Referenced by FuncPageTable::map().

struct cacheElement PageTableBase::pTableCache[3]
protected

Definition at line 66 of file page_table.hh.

Referenced by eraseCacheEntry(), FuncPageTable::lookup(), PageTableBase(), and updateCache().


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

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