Create a mapping to a specific range of physical memory Doesn't do any frame allocation, so assumes that it's ok to use the memory. Used for mapping a memory chunk to VGA memory.
(
level_4_physaddr: u64,
start_virtaddr: VirtAddr,
num_frames: u64,
start_physaddr: PhysAddr)
| 462 | /// to use the memory. Used for mapping a memory chunk to |
| 463 | /// VGA memory. |
| 464 | pub fn create_physical_range_pages( |
| 465 | level_4_physaddr: u64, |
| 466 | start_virtaddr: VirtAddr, |
| 467 | num_frames: u64, |
| 468 | start_physaddr: PhysAddr) |
| 469 | -> Result<PhysAddr, MapToError<Size4KiB>> { |
| 470 | |
| 471 | let start_page = Page::from_start_address(start_virtaddr) |
| 472 | .map_err(|_| MapToError::FrameAllocationFailed)?; |
| 473 | let start_frame = PhysFrame::from_start_address(start_physaddr) |
| 474 | .map_err(|_| MapToError::FrameAllocationFailed)?; |
| 475 | |
| 476 | map_consecutive_pages(level_4_physaddr, |
| 477 | start_page, |
| 478 | start_frame, |
| 479 | num_frames) |
| 480 | } |
| 481 | |
| 482 | /////////////////////////////////////////////////////////////////////// |
| 483 |
no test coverage detected