diff options
Diffstat (limited to 'src/mem/page_table.cc')
-rw-r--r-- | src/mem/page_table.cc | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/mem/page_table.cc b/src/mem/page_table.cc index 3854a8ccd..26cc6e537 100644 --- a/src/mem/page_table.cc +++ b/src/mem/page_table.cc @@ -146,29 +146,25 @@ EmulationPageTable::isUnmapped(Addr vaddr, int64_t size) return true; } -bool -EmulationPageTable::lookup(Addr vaddr, TheISA::TlbEntry &entry) +TheISA::TlbEntry * +EmulationPageTable::lookup(Addr vaddr) { Addr page_addr = pageAlign(vaddr); - PTableItr iter = pTable.find(page_addr); - if (iter == pTable.end()) - return false; - - entry = *iter->second; - return true; + return nullptr; + return iter->second; } bool EmulationPageTable::translate(Addr vaddr, Addr &paddr) { - TheISA::TlbEntry entry; - if (!lookup(vaddr, entry)) { + TheISA::TlbEntry *entry = lookup(vaddr); + if (!entry) { DPRINTF(MMU, "Couldn't Translate: %#x\n", vaddr); return false; } - paddr = pageOffset(vaddr) + entry.pageStart(); + paddr = pageOffset(vaddr) + entry->pageStart(); DPRINTF(MMU, "Translating: %#x->%#x\n", vaddr, paddr); return true; } |