pub struct PteProtector<'a, PTE, Mapper, Error>{
pub mapper: &'a mut Mapper,
pub mask: (PTE, PTE),
pub format: &'a PageFormat<'a, PTE>,
pub error: PhantomData<Error>,
}Expand description
The PteProtector struct is an implementation of a crate::walker::PageWalkerMut used to
change the protection flags of a given virtual address range. This function is used by the
AddressSpace::protect_range method.
Fields§
§mapper: &'a mut MapperThe page table mapper.
mask: (PTE, PTE)The protection flags that should be set. The first mask is the mask of bits that should be cleared. The second mask is the mask of bits that should be set.
format: &'a PageFormat<'a, PTE>The page format.
error: PhantomData<Error>A marker for Error.
Trait Implementations§
Source§impl<'a, PTE, Mapper, Error> PageWalkerMut<PTE, Error> for PteProtector<'a, PTE, Mapper, Error>
impl<'a, PTE, Mapper, Error> PageWalkerMut<PTE, Error> for PteProtector<'a, PTE, Mapper, Error>
Source§fn read_pte(&self, phys_addr: PTE) -> Result<PTE, Error>
fn read_pte(&self, phys_addr: PTE) -> Result<PTE, Error>
Reads the PTE at the given physical address.
Source§fn write_pte(&mut self, phys_addr: PTE, value: PTE) -> Result<(), Error>
fn write_pte(&mut self, phys_addr: PTE, value: PTE) -> Result<(), Error>
Writes the PTE to the given physical address.
Source§fn handle_pte(
&mut self,
pte_type: PteType,
_range: Range<usize>,
pte: &mut PTE,
) -> Result<(), Error>
fn handle_pte( &mut self, pte_type: PteType, _range: Range<usize>, pte: &mut PTE, ) -> Result<(), Error>
Checks if the PTE points to a page that is present, and changes the protection flags if so.
Source§fn handle_pte_hole(
&mut self,
_level: usize,
_range: Range<usize>,
_pte: &mut PTE,
) -> Result<(), Error>
fn handle_pte_hole( &mut self, _level: usize, _range: Range<usize>, _pte: &mut PTE, ) -> Result<(), Error>
This callback handles a PTE hole, i.e. a PTE that is not marked as present, and is given
the level, the virtual address range and a mutable reference to the PTE. The
implementation of this callback is optional.
Source§fn handle_post_pte(
&mut self,
_level: usize,
_range: Range<usize>,
_pte: &mut PTE,
) -> Result<(), Error>
fn handle_post_pte( &mut self, _level: usize, _range: Range<usize>, _pte: &mut PTE, ) -> Result<(), Error>
This callback handles the PTE of a page table after recursing the page table hierarchy, and
is given the level, the virtual address and a mutable reference to the PTE. The
implementation of this callback is optional.
Auto Trait Implementations§
impl<'a, PTE, Mapper, Error> Freeze for PteProtector<'a, PTE, Mapper, Error>where
PTE: Freeze,
impl<'a, PTE, Mapper, Error> RefUnwindSafe for PteProtector<'a, PTE, Mapper, Error>
impl<'a, PTE, Mapper, Error> Send for PteProtector<'a, PTE, Mapper, Error>
impl<'a, PTE, Mapper, Error> Sync for PteProtector<'a, PTE, Mapper, Error>
impl<'a, PTE, Mapper, Error> Unpin for PteProtector<'a, PTE, Mapper, Error>
impl<'a, PTE, Mapper, Error> UnsafeUnpin for PteProtector<'a, PTE, Mapper, Error>where
PTE: UnsafeUnpin,
impl<'a, PTE, Mapper, Error> !UnwindSafe for PteProtector<'a, PTE, Mapper, Error>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more