(
mapper: &mut impl Mapper<Size4KiB>,
frame_allocator: &mut impl FrameAllocator<Size4KiB>,
)
| 55 | } |
| 56 | |
| 57 | pub fn add_to_user_table( |
| 58 | mapper: &mut impl Mapper<Size4KiB>, |
| 59 | frame_allocator: &mut impl FrameAllocator<Size4KiB>, |
| 60 | ) -> Result<(), MapToError<Size4KiB>> { |
| 61 | let page = Page::containing_address( |
| 62 | VirtAddr::new(KERNELINFO_VIRTADDR)); |
| 63 | let frame = PhysFrame::containing_address( |
| 64 | PhysAddr::new(FRAME_PHYSADDR.load(Ordering::Relaxed))); |
| 65 | |
| 66 | unsafe { |
| 67 | mapper.map_to(page, |
| 68 | frame, |
| 69 | // Page not writable |
| 70 | PageTableFlags::PRESENT | |
| 71 | PageTableFlags::USER_ACCESSIBLE, |
| 72 | frame_allocator)?.flush(); |
| 73 | } |
| 74 | Ok(()) |
| 75 | } |
no outgoing calls
no test coverage detected