pub struct UserContext {
pub fs_base: u64,
pub gs_base: u64,
/* private fields */
}Available on crate feature
uspace only.Expand description
Context to enter user space.
Fields§
§fs_base: u64FS Segment Base
gs_base: u64GS Segment Base
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 prepare_clone_child_return_state(&mut self)
pub fn prepare_clone_child_return_state(&mut self)
Normalizes a cloned user context so it can safely return to ring 3.
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 rip).
This function returns when an exception or syscall occurs.
Methods from Deref<Target = TrapFrame>§
Sourcepub fn set_retval(&mut self, rax: usize)
pub fn set_retval(&mut self, rax: 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 (const: unstable) · 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