diff options
author | David Li <li.davidm96@gmail.com> | 2016-01-01 21:05:22 -0700 |
---|---|---|
committer | David Li <li.davidm96@gmail.com> | 2016-01-01 21:05:22 -0700 |
commit | 58e8da0ca937273221a02b625cc93b09f0240777 (patch) | |
tree | b31512fbaf5c5abb9baccc51316d85cd19c8f8bc /src | |
parent | d916938c7cd8954fa7f6d21815dc11f8aca211f9 (diff) |
Make MMU a trait for API user to implement
Diffstat (limited to 'src')
-rw-r--r-- | src/memory.rs | 5 |
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 { |