fn map_segment(
pgdir: *mut Pde,
asid: u32,
pa: usize,
va: usize,
size: usize,
perm: u32,
)Expand description
Map the [va, va + size) in virtual address space to the [pa, pa + size) in
physical address space if pgdir. This method will validate the entry perm.
§Panic
- Panic if one of the
pa,va,sizeis not aligned to a PAGE_SIZE. - Panic if the page_insert failed.
§Safety
The pgdir SHALL be valid.