(f: FUNC)
| 152 | } |
| 153 | |
| 154 | pub fn with_mapper_framealloc<FUNC, R>(f: FUNC) -> R |
| 155 | where |
| 156 | FUNC: FnOnce(&mut OffsetPageTable, &mut BootInfoFrameAllocator) -> R, |
| 157 | { |
| 158 | let mut mapper = MAPPER.get().unwrap().lock(); |
| 159 | let mut frame_allocator = FRAME_ALLOCATOR.get().unwrap().lock(); |
| 160 | let mapper = &mut *mapper; |
| 161 | let frame_allocator = &mut *frame_allocator; |
| 162 | f(mapper, frame_allocator) |
| 163 | } |
| 164 | |
| 165 | pub fn create_identity_virt_from_phys_n(pages: usize) -> Result<Page, MapToError<Size4KiB>> { |
| 166 | with_mapper_framealloc(|mapper, frame_allocator| { |
no outgoing calls
no test coverage detected