35 #ifndef __MEM_PAGE_TABLE_HH__ 36 #define __MEM_PAGE_TABLE_HH__ 39 #include <unordered_map> 56 Entry(
Addr paddr, uint64_t flags) : paddr(paddr), flags(flags) {}
61 typedef std::unordered_map<Addr, Entry>
PTable;
74 const std::string &__name, uint64_t _pid,
Addr _pageSize) :
76 _pid(_pid), _name(__name),
shared(false)
117 virtual void remap(
Addr vaddr, int64_t size,
Addr new_vaddr);
118 virtual void unmap(
Addr vaddr, int64_t size);
163 #endif // __MEM_PAGE_TABLE_HH__
virtual void remap(Addr vaddr, int64_t size, Addr new_vaddr)
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 std::string name() const
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Declaration of a request, the overall memory request consisting of the parts of the request that are ...
std::shared_ptr< Request > RequestPtr
std::unordered_map< Addr, Entry > PTable
bool translate(Addr vaddr)
Simplified translate function (just check for translation)
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Entry(Addr paddr, uint64_t flags)
std::enable_if< std::is_integral< T >::value, int >::type floorLog2(T x)
bool translate(Addr vaddr, Addr &paddr)
Translate function.
virtual ~EmulationPageTable()
EmulationPageTable(const std::string &__name, uint64_t _pid, Addr _pageSize)
bool isPowerOf2(const T &n)
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Basic support for object serialization.
virtual bool isUnmapped(Addr vaddr, int64_t size)
Check if any pages in a region are already allocated.
std::ostream CheckpointOut
PTable::iterator PTableItr
const Entry * lookup(Addr vaddr)
Lookup function.
virtual void unmap(Addr vaddr, int64_t size)
void getMappings(std::vector< std::pair< Addr, Addr >> *addr_mappings)
void serialize(CheckpointOut &cp) const override
Serialize an object.
std::shared_ptr< FaultBase > Fault