Fix typo in mips paging

master
Jiajie Chen 6 years ago
parent 6e5b3e2515
commit 8149793b9a

@ -23,7 +23,7 @@ impl PageTable for ActivePageTable {
let frame = Frame::of_addr(PhysAddr::new(target)); let frame = Frame::of_addr(PhysAddr::new(target));
// we may need frame allocator to alloc frame for new page table(first/second) // we may need frame allocator to alloc frame for new page table(first/second)
self.get_table() self.get_table()
.map_to(page, frame, flags, &mut FrameAllocatorForRiscv) .map_to(page, frame, flags, &mut FrameAllocatorForMips)
.unwrap() .unwrap()
.flush(); .flush();
self.get_entry(addr).expect("fail to get entry") self.get_entry(addr).expect("fail to get entry")
@ -254,15 +254,15 @@ impl Drop for InactivePageTable0 {
} }
} }
struct FrameAllocatorForRiscv; struct FrameAllocatorForMips;
impl FrameAllocator for FrameAllocatorForRiscv { impl FrameAllocator for FrameAllocatorForMips {
fn alloc(&mut self) -> Option<Frame> { fn alloc(&mut self) -> Option<Frame> {
alloc_frame().map(|addr| Frame::of_addr(PhysAddr::new(addr))) alloc_frame().map(|addr| Frame::of_addr(PhysAddr::new(addr)))
} }
} }
impl FrameDeallocator for FrameAllocatorForRiscv { impl FrameDeallocator for FrameAllocatorForMips {
fn dealloc(&mut self, frame: Frame) { fn dealloc(&mut self, frame: Frame) {
dealloc_frame(frame.start_address().as_usize()); dealloc_frame(frame.start_address().as_usize());
} }

Loading…
Cancel
Save