diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2007-08-28 14:30:50 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2007-08-28 14:30:50 -0700 |
commit | a3367adaff66997044553cb9a746e101418afbdd (patch) | |
tree | 4a26081985724fe95e9b993e8d49994d2e65a755 /src/arch/mips/tlb.cc | |
parent | 3ab19130770e04aaede1a3582959a01bb482b96b (diff) | |
download | gem5-a3367adaff66997044553cb9a746e101418afbdd.tar.xz |
Address translation: De-templatize the GenericTLB class.
--HG--
extra : convert_revision : b605a90a4a1071e39f49085a839fdcd175e09fdb
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) { |