74a75,77
> #else
> #include "mem/page_table.hh"
> #include "sim/process.hh"
93c96
< void
---
> TlbEntry *
108a112
> return newEntry;
141d144
< #if FULL_SYSTEM
143,149d145
< TLB::walk(ThreadContext * _tc, Addr vaddr, bool write, bool execute)
< {
< walker->start(_tc, vaddr, write, execute);
< }
< #endif
<
< void
191d186
< template<class TlbFault>
193,194c188,190
< TLB::translateAtomic(RequestPtr req, ThreadContext *tc,
< bool write, bool execute)
---
> TLB::translate(RequestPtr req, ThreadContext *tc,
> Translation *translation, bool write, bool execute,
> bool &delayedResponse, bool timing)
195a192
> delayedResponse = false;
620,626c617,648
< return new TlbFault(vaddr, write, execute);
< } else {
< // Do paging protection checks.
< DPRINTF(TLB, "Entry found with paddr %#x, doing protection checks.\n", entry->paddr);
< Addr paddr = entry->paddr | (vaddr & (entry->size-1));
< DPRINTF(TLB, "Translated %#x -> %#x.\n", vaddr, paddr);
< req->setPaddr(paddr);
---
> #if FULL_SYSTEM
> Fault fault = walker->start(tc, translation, req,
> write, execute);
> if (timing || fault != NoFault) {
> // This gets ignored in atomic mode.
> delayedResponse = true;
> return fault;
> }
> entry = lookup(vaddr);
> assert(entry);
> #else
> DPRINTF(TLB, "Handling a TLB miss for "
> "address %#x at pc %#x.\n",
> vaddr, tc->readPC());
>
> Process *p = tc->getProcessPtr();
> TlbEntry newEntry;
> bool success = p->pTable->lookup(vaddr, newEntry);
> if(!success && !execute) {
> p->checkAndAllocNextPage(vaddr);
> success = p->pTable->lookup(vaddr, newEntry);
> }
> if(!success) {
> panic("Tried to execute unmapped address %#x.\n", vaddr);
> } else {
> Addr alignedVaddr = p->pTable->pageAlign(vaddr);
> DPRINTF(TLB, "Mapping %#x to %#x\n", alignedVaddr,
> newEntry.pageStart());
> entry = insert(alignedVaddr, newEntry);
> }
> DPRINTF(TLB, "Miss was serviced.\n");
> #endif
627a650,655
> // Do paging protection checks.
> DPRINTF(TLB, "Entry found with paddr %#x, "
> "doing protection checks.\n", entry->paddr);
> Addr paddr = entry->paddr | (vaddr & (entry->size-1));
> DPRINTF(TLB, "Translated %#x -> %#x.\n", vaddr, paddr);
> req->setPaddr(paddr);
668c696,698
< return TLB::translateAtomic<FakeDTLBFault>(req, tc, write, false);
---
> bool delayedResponse;
> return TLB::translate(req, tc, NULL, write,
> false, delayedResponse, false);
674a705
> bool delayedResponse;
676c707,710
< translation->finish(translateAtomic(req, tc, write), req, tc, write);
---
> Fault fault = TLB::translate(req, tc, translation,
> write, false, delayedResponse, true);
> if (!delayedResponse)
> translation->finish(fault, req, tc, write);
682c716,718
< return TLB::translateAtomic<FakeITLBFault>(req, tc, false, true);
---
> bool delayedResponse;
> return TLB::translate(req, tc, NULL, false,
> true, delayedResponse, false);
688a725
> bool delayedResponse;
690c727,730
< translation->finish(translateAtomic(req, tc), req, tc, false);
---
> Fault fault = TLB::translate(req, tc, translation,
> false, true, delayedResponse, true);
> if (!delayedResponse)
> translation->finish(fault, req, tc, false);