Maps the page to the frame with the provided flags. The `PRESENT` flag is added by default. Needs a `FrameAllocator` as it might need to create new page tables.
(&mut self, page: Page, frame: Frame, flags: EntryFlags, allocator: &mut A)
| 71 | /// The `PRESENT` flag is added by default. Needs a `FrameAllocator` as it might need to create |
| 72 | /// new page tables. |
| 73 | pub fn map_to<A>(&mut self, page: Page, frame: Frame, flags: EntryFlags, allocator: &mut A) |
| 74 | where A: FrameAllocator |
| 75 | { |
| 76 | let mut p3 = self.p4_mut().next_table_create(page.p4_index(), allocator); |
| 77 | let mut p2 = p3.next_table_create(page.p3_index(), allocator); |
| 78 | let mut p1 = p2.next_table_create(page.p2_index(), allocator); |
| 79 | |
| 80 | assert!(p1[page.p1_index()].is_unused()); |
| 81 | p1[page.p1_index()].set(frame, flags | PRESENT); |
| 82 | } |
| 83 | |
| 84 | /// Maps the page to some free frame with the provided flags. |
| 85 | /// The free frame is allocated from the given `FrameAllocator`. |