pub struct UserContext {
pub sp: u64,
pub tpidr: u64,
/* private fields */
}Available on crate feature
uspace only.Expand description
Context to enter user space.
Fields§
§sp: u64Stack Pointer (SP_EL0).
tpidr: u64Software Thread ID Register (TPIDR_EL0).
Implementations§
Source§impl UserContext
impl UserContext
Sourcepub fn new(entry: usize, ustack_top: VirtAddr, arg0: usize) -> Self
pub fn new(entry: usize, ustack_top: VirtAddr, arg0: usize) -> Self
Creates a new context with the given entry point, user stack pointer, and the argument.
Sourcepub fn run(&mut self) -> ReturnReason
pub fn run(&mut self) -> ReturnReason
Enters user space.
It restores the user registers and jumps to the user entry point
(saved in elr).
This function returns when an exception or syscall occurs.
Methods from Deref<Target = TrapFrame>§
Sourcepub fn set_retval(&mut self, r0: usize)
pub fn set_retval(&mut self, r0: usize)
Sets the return value register.
Trait Implementations§
Source§impl Clone for UserContext
impl Clone for UserContext
Source§fn clone(&self) -> UserContext
fn clone(&self) -> UserContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UserContext
impl Debug for UserContext
Source§impl Deref for UserContext
impl Deref for UserContext
Source§impl DerefMut for UserContext
impl DerefMut for UserContext
impl Copy for UserContext
Auto Trait Implementations§
impl Freeze for UserContext
impl RefUnwindSafe for UserContext
impl Send for UserContext
impl Sync for UserContext
impl Unpin for UserContext
impl UnsafeUnpin for UserContext
impl UnwindSafe for UserContext
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