aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Li <li.davidm96@gmail.com>2016-01-01 21:05:22 -0700
committerDavid Li <li.davidm96@gmail.com>2016-01-01 21:05:22 -0700
commit58e8da0ca937273221a02b625cc93b09f0240777 (patch)
treeb31512fbaf5c5abb9baccc51316d85cd19c8f8bc
parentd916938c7cd8954fa7f6d21815dc11f8aca211f9 (diff)
Make MMU a trait for API user to implement
-rw-r--r--src/memory.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/memory.rs b/src/memory.rs
index 8fdf43d..5092f55 100644
--- a/src/memory.rs
+++ b/src/memory.rs
@@ -54,9 +54,8 @@ pub trait MemoryInterface {
pub type SharedMemory<'a> = Rc<RefCell<Box<MemoryInterface + 'a>>>;
-// TODO: should be a trait
-pub struct Mmu<T: MemoryInterface> {
- memory: T,
+pub trait Mmu {
+ fn translate(address: isa::Address) -> isa::Address;
}
pub struct Memory {