mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-25 02:13:24 +00:00
Use the HUGE/PAT bit to track the validity of x86 PTEs
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
b269118c9a
commit
dc7e0d7a63
@ -327,6 +327,10 @@ pub trait PageTableEntryTrait: Clone + Copy + Debug + Default + Pod + Sized + Sy
|
||||
}
|
||||
|
||||
/// If the flags are present with valid mappings.
|
||||
///
|
||||
/// For PTEs created by [`Self::new_absent`], this method should return
|
||||
/// false. And for PTEs created by [`Self::new_page`] or [`Self::new_pt`]
|
||||
/// and modified with [`Self::set_prop`] this method should return true.
|
||||
fn is_present(&self) -> bool;
|
||||
|
||||
/// Create a new PTE with the given physical address and flags that map to a page.
|
||||
@ -343,6 +347,10 @@ pub trait PageTableEntryTrait: Clone + Copy + Debug + Default + Pod + Sized + Sy
|
||||
|
||||
fn prop(&self) -> PageProperty;
|
||||
|
||||
/// Set the page property of the PTE.
|
||||
///
|
||||
/// This will be only done if the PTE is present. If not, this method will
|
||||
/// do nothing.
|
||||
fn set_prop(&mut self, prop: PageProperty);
|
||||
|
||||
/// If the PTE maps a page rather than a child page table.
|
||||
|
Reference in New Issue
Block a user