626a627,634
> return;
> }
>
> Process *p = tc->getProcessPtr();
> TlbEntry entry;
> bool success = p->pTable->lookup(vaddr, entry);
> if (!success) {
> panic("Tried to execute unmapped address %#x.\n", vaddr);
628,637c636,638
< Process *p = tc->getProcessPtr();
< TlbEntry entry;
< bool success = p->pTable->lookup(vaddr, entry);
< if (!success) {
< panic("Tried to execute unmapped address %#x.\n", vaddr);
< } else {
< Addr alignedVaddr = p->pTable->pageAlign(vaddr);
< tc->getITBPtr()->insert(alignedVaddr, 0 /*partition id*/,
< p->M5_pid /*context id*/, false, entry.pte);
< }
---
> Addr alignedVaddr = p->pTable->pageAlign(vaddr);
> tc->getITBPtr()->insert(alignedVaddr, 0 /*partition id*/,
> p->M5_pid /*context id*/, false, entry.pte);
645a647,658
> return;
> }
>
> Process *p = tc->getProcessPtr();
> TlbEntry entry;
> bool success = p->pTable->lookup(vaddr, entry);
> if (!success) {
> if (p->fixupStackFault(vaddr))
> success = p->pTable->lookup(vaddr, entry);
> }
> if (!success) {
> panic("Tried to access unmapped address %#x.\n", vaddr);
647,660c660,662
< Process *p = tc->getProcessPtr();
< TlbEntry entry;
< bool success = p->pTable->lookup(vaddr, entry);
< if (!success) {
< if (p->fixupStackFault(vaddr))
< success = p->pTable->lookup(vaddr, entry);
< }
< if (!success) {
< panic("Tried to access unmapped address %#x.\n", vaddr);
< } else {
< Addr alignedVaddr = p->pTable->pageAlign(vaddr);
< tc->getDTBPtr()->insert(alignedVaddr, 0 /*partition id*/,
< p->M5_pid /*context id*/, false, entry.pte);
< }
---
> Addr alignedVaddr = p->pTable->pageAlign(vaddr);
> tc->getDTBPtr()->insert(alignedVaddr, 0 /*partition id*/,
> p->M5_pid /*context id*/, false, entry.pte);
669,670c671,672
< } else {
< doNormalFault(tc, trapType(), false);
---
> return;
> }
672c674
< Process *p = tc->getProcessPtr();
---
> doNormalFault(tc, trapType(), false);
674,676c676
< //XXX This will only work in faults from a SparcLiveProcess
< SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p);
< assert(lp);
---
> Process *p = tc->getProcessPtr();
678,680c678,683
< // Then adjust the PC and NPC
< tc->pcState(lp->readSpillStart());
< }
---
> //XXX This will only work in faults from a SparcLiveProcess
> SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p);
> assert(lp);
>
> // Then adjust the PC and NPC
> tc->pcState(lp->readSpillStart());
688,689c691,692
< } else {
< doNormalFault(tc, trapType(), false);
---
> return;
> }
691c694
< Process *p = tc->getProcessPtr();
---
> doNormalFault(tc, trapType(), false);
693,695c696
< //XXX This will only work in faults from a SparcLiveProcess
< SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p);
< assert(lp);
---
> Process *p = tc->getProcessPtr();
697,699c698,703
< // Then adjust the PC and NPC
< tc->pcState(lp->readFillStart());
< }
---
> //XXX This will only work in faults from a SparcLiveProcess
> SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p);
> assert(lp);
>
> // Then adjust the PC and NPC
> tc->pcState(lp->readFillStart());
707,710c711,712
< } else {
< // In SE, this mechanism is how the process requests a service from
< // the operating system. We'll get the process object from the thread
< // context and let it service the request.
---
> return;
> }
712c714,716
< Process *p = tc->getProcessPtr();
---
> // In SE, this mechanism is how the process requests a service from
> // the operating system. We'll get the process object from the thread
> // context and let it service the request.
714,715c718
< SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p);
< assert(lp);
---
> Process *p = tc->getProcessPtr();
717c720,721
< lp->handleTrap(_n, tc);
---
> SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p);
> assert(lp);
719,724c723,729
< // We need to explicitly advance the pc, since that's not done for us
< // on a faulting instruction
< PCState pc = tc->pcState();
< pc.advance();
< tc->pcState(pc);
< }
---
> lp->handleTrap(_n, tc);
>
> // We need to explicitly advance the pc, since that's not done for us
> // on a faulting instruction
> PCState pc = tc->pcState();
> pc.advance();
> tc->pcState(pc);