43 #include "config/the_isa.hh"
44 #include "debug/MMU.hh"
49 using namespace TheISA;
52 uint64_t _pid,
Addr _pageSize)
68 DPRINTF(MMU,
"Allocating Page: %#x-%#x\n", vaddr, vaddr+ size);
73 fatal(
"FuncPageTable::allocate: addr 0x%x already mapped", vaddr);
90 DPRINTF(MMU,
"moving pages from vaddr %08p to %08p, size = %d\n", vaddr,
101 pTable[new_vaddr].updateVaddr(new_vaddr);
110 addr_maps->push_back(make_pair(iter.first, iter.second.pageStart()));
118 DPRINTF(MMU,
"Unmapping page: %#x-%#x\n", vaddr, vaddr+ size);
163 if (iter ==
pTable.end()) {
168 entry = iter->second;
176 if (!
lookup(vaddr, entry)) {
177 DPRINTF(MMU,
"Couldn't Translate: %#x\n", vaddr);
180 paddr =
pageOffset(vaddr) + entry.pageStart();
181 DPRINTF(MMU,
"Translating: %#x->%#x\n", vaddr, paddr);
196 panic(
"Request spans page boundaries!\n");
208 for (
auto &pte :
pTable) {
212 pte.second.serialize(cp);
214 assert(count == pTable.size());
221 paramIn(cp,
"ptable.size", count);
226 std::unique_ptr<TheISA::TlbEntry> entry;
231 entry->unserialize(cp);
decltype(nullptr) constexpr NoFault
void updateCache(Addr vaddr, TheISA::TlbEntry entry)
Update the page table cache.
bool isUnmapped(Addr vaddr, int64_t size) override
Check if any pages in a region are already allocated.
FuncPageTable(const std::string &__name, uint64_t _pid, Addr _pageSize=TheISA::PageBytes)
void map(Addr vaddr, Addr paddr, int64_t size, uint64_t flags=0) override
Maps a virtual memory region to a physical memory region.
PTable::iterator PTableItr
void remap(Addr vaddr, int64_t size, Addr new_vaddr) override
std::string csprintf(const char *format, const Args &...args)
bool translate(Addr vaddr, Addr &paddr)
Translate function.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void paramOut(CheckpointOut &cp, const string &name, ExtMachInst const &machInst)
TlbEntry(Addr asn, Addr _vaddr, Addr _paddr, bool uncacheable, bool read_only)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Declaration of base class for page table.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void unmap(Addr vaddr, int64_t size) override
Declarations of a non-full system Page Table.
void getMappings(std::vector< std::pair< Addr, Addr >> *addr_maps) override
std::ostream CheckpointOut
bool lookup(Addr vaddr, TheISA::TlbEntry &entry) override
Lookup function.
virtual bool lookup(Addr vaddr, TheISA::TlbEntry &entry)=0
Lookup function.
void paramIn(CheckpointIn &cp, const string &name, ExtMachInst &machInst)
void eraseCacheEntry(Addr vaddr)
Erase an entry from the page table cache.
struct cacheElement pTableCache[3]
Scoped checkpoint section helper class.
void setPaddr(Addr paddr)
Set just the physical address.
std::shared_ptr< FaultBase > Fault