summaryrefslogtreecommitdiff
path: root/src/arch/power/tlb.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/power/tlb.cc')
-rw-r--r--src/arch/power/tlb.cc32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/arch/power/tlb.cc b/src/arch/power/tlb.cc
index 125c92a1a..292f13078 100644
--- a/src/arch/power/tlb.cc
+++ b/src/arch/power/tlb.cc
@@ -281,9 +281,27 @@ TLB::regStats()
}
Fault
-TLB::translateAtomic(RequestPtr req, ThreadContext *tc, Mode mode)
+TLB::translateInst(RequestPtr req, ThreadContext *tc)
+{
+ // Instruction accesses must be word-aligned
+ if (req->getVaddr() & 0x3) {
+ DPRINTF(TLB, "Alignment Fault on %#x, size = %d\n", req->getVaddr(),
+ req->getSize());
+ return new AlignmentFault();
+ }
+
+ Process * p = tc->getProcessPtr();
+
+ Fault fault = p->pTable->translate(req);
+ if (fault != NoFault)
+ return fault;
+
+ return NoFault;
+}
+
+Fault
+TLB::translateData(RequestPtr req, ThreadContext *tc, bool write)
{
-#if !FULL_SYSTEM
Process * p = tc->getProcessPtr();
Fault fault = p->pTable->translate(req);
@@ -291,6 +309,16 @@ TLB::translateAtomic(RequestPtr req, ThreadContext *tc, Mode mode)
return fault;
return NoFault;
+}
+
+Fault
+TLB::translateAtomic(RequestPtr req, ThreadContext *tc, Mode mode)
+{
+#if !FULL_SYSTEM
+ if (mode == Execute)
+ return translateInst(req, tc);
+ else
+ return translateData(req, tc, mode == Write);
#else
fatal("translate atomic not yet implemented\n");
#endif