Struct hal_x86_64::mm::page::Handle
pub struct Handle<'mapper, S, E>{ /* private fields */ }
Expand description
A page in the process of being remapped.
This reference allows updating page table flags prior to committing changes.
Implementations§
§impl<'mapper, S, E> Handle<'mapper, S, E>
impl<'mapper, S, E> Handle<'mapper, S, E>
pub fn new(page: Page<VAddr, S>, entry: &'mapper mut E) -> Handle<'mapper, S, E>
pub fn virt_page(&self) -> &Page<VAddr, S>
pub fn virt_page(&self) -> &Page<VAddr, S>
Returns the virtual page this entry is currently mapped to.
pub unsafe fn set_writable(self, writable: bool) -> Handle<'mapper, S, E>
pub unsafe fn set_writable(self, writable: bool) -> Handle<'mapper, S, E>
Set whether or not this page is writable.
Safety
Manual control of page flags can be used to violate Rust invariants.
Using set_writable
to make memory that the Rust compiler expects to be
read-only may cause undefined behavior. Making a page which is aliased
page table (i.e. it has multiple page table entries pointing to it) may
also cause undefined behavior.
pub unsafe fn set_executable(self, executable: bool) -> Handle<'mapper, S, E>
pub unsafe fn set_executable(self, executable: bool) -> Handle<'mapper, S, E>
Set whether or not this page is executable.
Safety
Manual control of page flags can be used to violate Rust invariants.
Using set_executable
to make writable memory executable may cause
undefined behavior. Also, this can be used to execute the contents of
arbitrary memory, which (of course) is wildly unsafe.
pub unsafe fn set_present(self, present: bool) -> Handle<'mapper, S, E>
pub unsafe fn set_present(self, present: bool) -> Handle<'mapper, S, E>
Set whether or not this page is present.
Safety
Manual control of page flags can be used to violate Rust invariants.