mips-tlb-fix: check for alignment faults.\nMIPS was never updated to use TLBS correct...
authorKorey Sewell <ksewell@umich.edu>
Sat, 18 Apr 2009 14:42:29 +0000 (10:42 -0400)
committerKorey Sewell <ksewell@umich.edu>
Sat, 18 Apr 2009 14:42:29 +0000 (10:42 -0400)
src/arch/mips/tlb.cc

index 9fc3e20eecd83eea8112d3340c731ef56dc554b7..001dc2cb78f148ebf0b9c6c347200a8e7fce6341 100644 (file)
@@ -427,6 +427,18 @@ Fault
 TLB::translateData(RequestPtr req, ThreadContext *tc, bool write)
 {
 #if !FULL_SYSTEM
+    //@TODO: This should actually use TLB instead of going directly
+    //       to the page table in syscall mode.
+    /**
+     * Check for alignment faults
+     */
+    if (req->getVaddr() & (req->getSize() - 1)) {
+        DPRINTF(TLB, "Alignment Fault on %#x, size = %d", req->getVaddr(),
+                req->getSize());
+        return new AlignmentFault();
+    }
+
+
     Process * p = tc->getProcessPtr();
 
     Fault fault = p->pTable->translate(req);