diff options
Diffstat (limited to 'src/arch/alpha/faults.cc')
-rw-r--r-- | src/arch/alpha/faults.cc | 67 |
1 files changed, 60 insertions, 7 deletions
diff --git a/src/arch/alpha/faults.cc b/src/arch/alpha/faults.cc index 149729351..7d4de902a 100644 --- a/src/arch/alpha/faults.cc +++ b/src/arch/alpha/faults.cc @@ -29,13 +29,13 @@ * Kevin Lim */ +#include "arch/alpha/ev5.hh" #include "arch/alpha/faults.hh" +#include "arch/alpha/tlb.hh" #include "cpu/thread_context.hh" #include "cpu/base.hh" #include "base/trace.hh" -#if FULL_SYSTEM -#include "arch/alpha/ev5.hh" -#else +#if !FULL_SYSTEM #include "sim/process.hh" #include "mem/page_table.hh" #endif @@ -83,10 +83,6 @@ FaultName DtbAlignmentFault::_name = "unalign"; FaultVect DtbAlignmentFault::_vect = 0x0301; FaultStat DtbAlignmentFault::_count; -FaultName ItbMissFault::_name = "itbmiss"; -FaultVect ItbMissFault::_vect = 0x0181; -FaultStat ItbMissFault::_count; - FaultName ItbPageFault::_name = "itbmiss"; FaultVect ItbPageFault::_vect = 0x0181; FaultStat ItbPageFault::_count; @@ -176,6 +172,63 @@ void ItbFault::invoke(ThreadContext * tc) AlphaFault::invoke(tc); } +#else + +void ItbPageFault::invoke(ThreadContext * tc) +{ + Process *p = tc->getProcessPtr(); + Addr physaddr; + bool success = p->pTable->translate(pc, physaddr); + if(!success) { + panic("Tried to execute unmapped address %#x.\n", pc); + } else { + VAddr vaddr(pc); + VAddr paddr(physaddr); + + TlbEntry entry; + entry.tag = vaddr.vpn(); + entry.ppn = paddr.vpn(); + entry.xre = 15; //This can be read in all modes. + entry.xwe = 1; //This can be written only in kernel mode. + entry.asn = p->M5_pid; //Address space number. + entry.asma = false; //Only match on this ASN. + entry.fonr = false; //Don't fault on read. + entry.fonw = false; //Don't fault on write. + entry.valid = true; //This entry is valid. + + tc->getITBPtr()->insert(vaddr.page(), entry); + } +} + +void NDtbMissFault::invoke(ThreadContext * tc) +{ + Process *p = tc->getProcessPtr(); + Addr physaddr; + bool success = p->pTable->translate(vaddr, physaddr); + if(!success) { + p->checkAndAllocNextPage(vaddr); + success = p->pTable->translate(vaddr, physaddr); + } + if(!success) { + panic("Tried to access unmapped address %#x.\n", (Addr)vaddr); + } else { + VAddr paddr(physaddr); + + TlbEntry entry; + entry.tag = vaddr.vpn(); + entry.ppn = paddr.vpn(); + entry.xre = 15; //This can be read in all modes. + entry.xwe = 15; //This can be written in all modes. + entry.asn = p->M5_pid; //Address space number. + entry.asma = false; //Only match on this ASN. + entry.fonr = false; //Don't fault on read. + entry.fonw = false; //Don't fault on write. + entry.valid = true; //This entry is valid. + + tc->getDTBPtr()->insert(vaddr.page(), entry); + } +} + #endif } // namespace AlphaISA |