pub struct ThreadState {
pub registers: RegisterState,
pub extended_pstate: ExtendedPstateState,
pub restart_code: Option<ErrnoCode>,
pub syscall_restart_func: Option<Box<dyn FnOnce(&mut Locked<Unlocked>, &mut CurrentTask) -> Result<SyscallResult, Errno> + Send + Sync>>,
pub arch_width: ArchWidth,
}Expand description
The thread related information of a CurrentTask. The information should never be used outside
of the thread owning the CurrentTask.
Fields§
§registers: RegisterStateA copy of the registers associated with the Zircon thread. Up-to-date values can be read
from self.handle.read_state_general_regs(). To write these values back to the thread, call
self.handle.write_state_general_regs(self.thread_state.registers.into()).
extended_pstate: ExtendedPstateStateCopy of the current extended processor state including floating point and vector registers.
restart_code: Option<ErrnoCode>The errno code (if any) that indicated this task should restart a syscall.
syscall_restart_func: Option<Box<dyn FnOnce(&mut Locked<Unlocked>, &mut CurrentTask) -> Result<SyscallResult, Errno> + Send + Sync>>A custom function to resume a syscall that has been interrupted by SIGSTOP. To use, call set_syscall_restart_func and return ERESTART_RESTARTBLOCK. sys_restart_syscall will eventually call it.
arch_width: ArchWidthAn architecture agnostic enum indicating the width (32 or 64 bits) of the execution environment in use.
Implementations§
Source§impl ThreadState
impl ThreadState
pub fn extended_snapshot(&self) -> Self
pub fn replace_registers(&mut self, other: &ThreadState)
pub fn get_user_register(&mut self, offset: usize) -> Result<usize, Errno>
pub fn set_user_register( &mut self, offset: usize, value: usize, ) -> Result<(), Errno>
Trait Implementations§
Source§impl ArchSpecific for ThreadState
impl ArchSpecific for ThreadState
Source§impl Default for ThreadState
impl Default for ThreadState
Source§fn default() -> ThreadState
fn default() -> ThreadState
Auto Trait Implementations§
impl Freeze for ThreadState
impl !RefUnwindSafe for ThreadState
impl Send for ThreadState
impl Sync for ThreadState
impl Unpin for ThreadState
impl !UnwindSafe for ThreadState
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more