From b7ba05db1185849b955f23e1ab023b1819243ddf Mon Sep 17 00:00:00 2001
From: David Li
Date: Sat, 9 Jan 2016 15:33:23 -0700
Subject: Fix ReverseMmu address translation
---
src/memory.rs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'src')
diff --git a/src/memory.rs b/src/memory.rs
index b822fac..768ce59 100644
--- a/src/memory.rs
+++ b/src/memory.rs
@@ -154,7 +154,8 @@ impl ReverseMmu {
impl Mmu for ReverseMmu {
fn translate(&self, address: isa::Address) -> isa::Address {
- self.top - address
+ let offset = address % 4;
+ (self.top - (address - offset)) + offset
}
}
--
cgit v1.2.3