using namespace TheISA;
template <class ISAOps>
-MultiLevelPageTable<ISAOps>::MultiLevelPageTable(const std::string &__name, uint64_t _pid, System *_sys)
+MultiLevelPageTable<ISAOps>::MultiLevelPageTable(const std::string &__name,
+ uint64_t _pid, System *_sys)
: PageTableBase(__name, _pid), system(_sys),
logLevelSize(PageTableLayout),
numLevels(logLevelSize.size())
assert(log_req_size >= PageShift);
uint64_t npages = 1 << (log_req_size - PageShift);
- DPRINTF(MMU, "Allocating %d pages needed for entry in level %d\n", npages, i-1);
+ DPRINTF(MMU, "Allocating %d pages needed for entry in level %d\n",
+ npages, i - 1);
/* allocate new entry */
Addr next_entry_paddr = system->allocPhysPages(npages);
p.write<PageTableEntry>(entry_addr, entry);
}
- DPRINTF(MMU, "Level %d base: %d offset: %d entry: %d\n", i, level_base, offsets[i], next_entry_pnum);
+ DPRINTF(MMU, "Level %d base: %d offset: %d entry: %d\n",
+ i, level_base, offsets[i], next_entry_pnum);
level_base = next_entry_pnum;
}
template <class ISAOps>
void
-MultiLevelPageTable<ISAOps>::map(Addr vaddr, Addr paddr, int64_t size, bool clobber)
+MultiLevelPageTable<ISAOps>::map(Addr vaddr, Addr paddr,
+ int64_t size, bool clobber)
{
// starting address must be page aligned
assert(pageOffset(vaddr) == 0);
p.write<PageTableEntry>(PTE_addr, PTE);
DPRINTF(MMU, "New mapping: %#x-%#x\n", vaddr, paddr);
} else {
- fatal("address 0x%x already mapped to %x", vaddr, entry_paddr);
+ fatal("addr 0x%x already mapped to %x", vaddr, entry_paddr);
}
eraseCacheEntry(vaddr);
PortProxy &p = system->physProxy;
- for (; size > 0; size -= pageSize, vaddr += pageSize, new_vaddr += pageSize) {
+ for (; size > 0;
+ size -= pageSize, vaddr += pageSize, new_vaddr += pageSize)
+ {
Addr PTE_addr;
if (walk(vaddr, false, PTE_addr)) {
PageTableEntry PTE = p.read<PageTableEntry>(PTE_addr);
template <class ISAOps>
void
-MultiLevelPageTable<ISAOps>::unserialize(Checkpoint *cp, const std::string §ion)
+MultiLevelPageTable<ISAOps>::unserialize(Checkpoint *cp,
+ const std::string §ion)
{
paramIn(cp, section, "ptable.pointer", basePtr);
}
using namespace std;
using namespace TheISA;
-FuncPageTable::FuncPageTable(const std::string &__name, uint64_t _pid, Addr _pageSize)
+FuncPageTable::FuncPageTable(const std::string &__name,
+ uint64_t _pid, Addr _pageSize)
: PageTableBase(__name, _pid, _pageSize)
{
}
for (; size > 0; size -= pageSize, vaddr += pageSize, paddr += pageSize) {
if (!clobber && (pTable.find(vaddr) != pTable.end())) {
// already mapped
- fatal("FuncPageTable::allocate: address 0x%x already mapped", vaddr);
+ fatal("FuncPageTable::allocate: addr 0x%x already mapped", vaddr);
}
pTable[vaddr] = TheISA::TlbEntry(pid, vaddr, paddr);
DPRINTF(MMU, "moving pages from vaddr %08p to %08p, size = %d\n", vaddr,
new_vaddr, size);
- for (; size > 0; size -= pageSize, vaddr += pageSize, new_vaddr += pageSize) {
+ for (; size > 0;
+ size -= pageSize, vaddr += pageSize, new_vaddr += pageSize)
+ {
assert(pTable.find(vaddr) != pTable.end());
pTable[new_vaddr] = pTable[vaddr];
Addr pageAlign(Addr a) { return (a & ~offsetMask); }
Addr pageOffset(Addr a) { return (a & offsetMask); }
- virtual void map(Addr vaddr, Addr paddr, int64_t size, bool clobber = false) = 0;
+ virtual void map(Addr vaddr, Addr paddr, int64_t size,
+ bool clobber = false) = 0;
virtual void remap(Addr vaddr, int64_t size, Addr new_vaddr) = 0;
virtual void unmap(Addr vaddr, int64_t size) = 0;