pub struct RestrictedState { /* private fields */ }Expand description
Encapsulates a thread’s restricted mode state, including VMO backing and mapping.
The memory layout of this struct (#[repr(C)]) must exactly match its C++ counterpart
(class RestrictedState in zircon/kernel/include/kernel/restricted_state.h), as instances
allocated here are directly accessed from C++ code by pointer. Any changes to field types,
names, ordering, or layout must be kept in sync between the two definitions, and verified via
static assertions.
Implementations§
Source§impl RestrictedState
impl RestrictedState
Sourcepub fn create(
exception_report_ptr: *mut zx_exception_report_t,
) -> Result<Box<Self>, Status>
pub fn create( exception_report_ptr: *mut zx_exception_report_t, ) -> Result<Box<Self>, Status>
Create a new RestrictedState, allocating its VMO and mapping in kernel memory.
Sourcepub fn in_restricted(&self) -> bool
pub fn in_restricted(&self) -> bool
Return whether the thread is currently in restricted mode.
Sourcepub fn set_in_restricted(&mut self, val: bool)
pub fn set_in_restricted(&mut self, val: bool)
Set whether the thread is currently in restricted mode.
Sourcepub fn vector_ptr(&self) -> usize
pub fn vector_ptr(&self) -> usize
Return the normal mode vector table pointer.
Sourcepub fn set_vector_ptr(&mut self, val: usize)
pub fn set_vector_ptr(&mut self, val: usize)
Set the normal mode vector table pointer.
Sourcepub fn set_context(&mut self, val: usize)
pub fn set_context(&mut self, val: usize)
Set the normal mode context value.
Sourcepub fn exception_report_ptr(&self) -> *mut zx_exception_report_t
pub fn exception_report_ptr(&self) -> *mut zx_exception_report_t
Return the user exception report pointer address.
Sourcepub fn arch_normal_state(&self) -> &ArchSavedNormalState
pub fn arch_normal_state(&self) -> &ArchSavedNormalState
Return a shared reference to the saved normal mode architecture state.
Sourcepub fn arch_normal_state_mut(&mut self) -> &mut ArchSavedNormalState
pub fn arch_normal_state_mut(&mut self) -> &mut ArchSavedNormalState
Return a mutable reference to the saved normal mode architecture state.
Sourcepub fn state(&self) -> &zx_restricted_state_t
pub fn state(&self) -> &zx_restricted_state_t
Return a shared reference to the mapped zx_restricted_state_t buffer.
Sourcepub fn state_mut(&mut self) -> &mut zx_restricted_state_t
pub fn state_mut(&mut self) -> &mut zx_restricted_state_t
Return a mutable reference to the mapped zx_restricted_state_t buffer.
Sourcepub fn state_ptr(&self) -> *mut zx_restricted_state_t
pub fn state_ptr(&self) -> *mut zx_restricted_state_t
Return a raw pointer to the mapped zx_restricted_state_t buffer.
Trait Implementations§
Source§impl Drop for RestrictedState
impl Drop for RestrictedState
Auto Trait Implementations§
impl !Send for RestrictedState
impl !Sync for RestrictedState
impl Freeze for RestrictedState
impl RefUnwindSafe for RestrictedState
impl Unpin for RestrictedState
impl UnsafeUnpin for RestrictedState
impl UnwindSafe for RestrictedState
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
slot. Read moreSource§fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>where
F: FnOnce(Pin<&mut T>) -> Result<(), E>,
fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>where
F: FnOnce(Pin<&mut T>) -> Result<(), E>,
self then calls the function f with the initialized
value. Read more