Optimize the clear procedure of the page table

This commit is contained in:
Chen Chengjun
2024-09-29 17:23:43 +08:00
committed by Tate, Hongliang Tian
parent 4fa0e6334b
commit 8f50391a4e
3 changed files with 43 additions and 22 deletions

View File

@ -339,10 +339,8 @@ impl Vmar_ {
}
fn clear_vm_space(&self) {
let start = ROOT_VMAR_LOWEST_ADDR;
let end = ROOT_VMAR_CAP_ADDR;
let mut cursor = self.vm_space.cursor_mut(&(start..end)).unwrap();
cursor.unmap(end - start);
let mut cursor = self.vm_space.cursor_mut(&(0..ROOT_VMAR_CAP_ADDR)).unwrap();
cursor.unmap(ROOT_VMAR_CAP_ADDR);
}
pub fn destroy(&self, range: Range<usize>) -> Result<()> {