35#ifndef __MEM_PAGE_TABLE_HH__
36#define __MEM_PAGE_TABLE_HH__
39#include <unordered_map>
66 typedef std::unordered_map<Addr, Entry>
PTable;
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
PageTableTranslationGen(EmulationPageTable *_pt, Addr vaddr, Addr size)
void translate(Range &range) const override
Subclasses implement this function to complete TranslationGen.
virtual void map(Addr vaddr, Addr paddr, int64_t size, uint64_t flags=0)
Maps a virtual memory region to a physical memory region.
const Entry * lookup(Addr vaddr)
Lookup function.
virtual void remap(Addr vaddr, int64_t size, Addr new_vaddr)
bool translate(Addr vaddr)
Simplified translate function (just check for translation)
void serialize(CheckpointOut &cp) const override
Serialize an object.
bool translate(Addr vaddr, Addr &paddr)
Translate function.
PTable::iterator PTableItr
virtual void unmap(Addr vaddr, int64_t size)
const std::string externalize() const
Dump all items in the pTable, to a concatenation of strings of the form Addr:Entry;.
virtual ~EmulationPageTable()
virtual bool isUnmapped(Addr vaddr, int64_t size)
Check if any pages in a region are already allocated.
const std::string name() const
void unserialize(CheckpointIn &cp) override
Unserialize an object.
EmulationPageTable(const std::string &__name, uint64_t _pid, Addr _pageSize)
void getMappings(std::vector< std::pair< Addr, Addr > > *addr_mappings)
std::unordered_map< Addr, Entry > PTable
TranslationGenPtr translateRange(Addr vaddr, Addr size)
Basic support for object serialization.
TranslationGen is a base class for a generator object which returns information about address transla...
static constexpr std::enable_if_t< std::is_integral_v< T >, int > floorLog2(T x)
static constexpr bool isPowerOf2(const T &n)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::shared_ptr< FaultBase > Fault
std::shared_ptr< Request > RequestPtr
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
std::unique_ptr< TranslationGen > TranslationGenPtr
Declaration of a request, the overall memory request consisting of the parts of the request that are ...
Entry(Addr paddr, uint64_t flags)
This structure represents a single, contiguous translation, or carries information about whatever fau...