diff options
Diffstat (limited to 'src/arch/mips/tlb.cc')
-rw-r--r-- | src/arch/mips/tlb.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/arch/mips/tlb.cc b/src/arch/mips/tlb.cc index 71111b843..41a26aba1 100644 --- a/src/arch/mips/tlb.cc +++ b/src/arch/mips/tlb.cc @@ -35,6 +35,24 @@ #include "params/MipsITB.hh" namespace MipsISA { + Fault + TLB::translate(RequestPtr req, ThreadContext *tc, bool) + { + Fault fault = GenericTLB::translate(req, tc); + if (fault != NoFault) + return fault; + + typeof(req->getSize()) size = req->getSize(); + Addr paddr = req->getPaddr(); + + if (!isPowerOf2(size)) + panic("Invalid request size!\n"); + if ((size - 1) & paddr) + return new GenericAlignmentFault(paddr); + + return NoFault; + } + void TlbEntry::serialize(std::ostream &os) { |