Take page by value in mapping functions

(there is no reason to borrow it at the moment)
This commit is contained in:
Philipp Oppermann
2015-12-07 11:01:22 +01:00
parent b314d4827f
commit 15427b363a
2 changed files with 9 additions and 9 deletions

View File

@@ -129,14 +129,14 @@ impl RecursivePageTable {
.or_else(huge_page)
}
pub fn map<A>(&mut self, page: &Page, flags: EntryFlags, allocator: &mut A)
pub fn map<A>(&mut self, page: Page, flags: EntryFlags, allocator: &mut A)
where A: FrameAllocator
{
let frame = allocator.allocate_frame().expect("out of memory");
self.map_to(page, frame, flags, allocator)
}
pub fn map_to<A>(&mut self, page: &Page, frame: Frame, flags: EntryFlags, allocator: &mut A)
pub fn map_to<A>(&mut self, page: Page, frame: Frame, flags: EntryFlags, allocator: &mut A)
where A: FrameAllocator
{
let mut p3 = self.p4_mut().next_table_create(page.p4_index(), allocator);
@@ -151,11 +151,11 @@ impl RecursivePageTable {
where A: FrameAllocator
{
let page = Page::containing_address(frame.start_address());
self.map_to(&page, frame, flags, allocator)
self.map_to(page, frame, flags, allocator)
}
fn unmap<A>(&mut self, page: &Page, allocator: &mut A)
fn unmap<A>(&mut self, page: Page, allocator: &mut A)
where A: FrameAllocator
{
use x86::tlb;