Struct trapframe::UserContext
source · [−]#[repr(C)]pub struct UserContext {
pub general: GeneralRegs,
pub trap_num: usize,
pub error_code: usize,
}
Expand description
User space context
Fields
general: GeneralRegs
trap_num: usize
error_code: usize
Implementations
sourceimpl UserContext
impl UserContext
sourcepub fn run_fncall(&mut self)
pub fn run_fncall(&mut self)
Go to user context by function return, within the same privilege level.
User program should call syscall_fn_entry()
to return back.
Trap reason and error code will always be set to 0x100 and 0.
sourceimpl UserContext
impl UserContext
sourcepub fn get_syscall_num(&self) -> usize
pub fn get_syscall_num(&self) -> usize
Get number of syscall
sourcepub fn get_syscall_ret(&self) -> usize
pub fn get_syscall_ret(&self) -> usize
Get return value of syscall
sourcepub fn set_syscall_ret(&mut self, ret: usize)
pub fn set_syscall_ret(&mut self, ret: usize)
Set return value of syscall
sourcepub fn get_syscall_args(&self) -> [usize; 6]
pub fn get_syscall_args(&self) -> [usize; 6]
Get syscall args
Trait Implementations
sourceimpl Clone for UserContext
impl Clone for UserContext
sourcefn clone(&self) -> UserContext
fn clone(&self) -> UserContext
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for UserContext
impl Debug for UserContext
sourceimpl Default for UserContext
impl Default for UserContext
sourcefn default() -> UserContext
fn default() -> UserContext
Returns the “default value” for a type. Read more
sourceimpl PartialEq<UserContext> for UserContext
impl PartialEq<UserContext> for UserContext
sourcefn eq(&self, other: &UserContext) -> bool
fn eq(&self, other: &UserContext) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &UserContext) -> bool
fn ne(&self, other: &UserContext) -> bool
This method tests for !=
.
impl Copy for UserContext
impl Eq for UserContext
impl StructuralEq for UserContext
impl StructuralPartialEq for UserContext
Auto Trait Implementations
impl RefUnwindSafe for UserContext
impl Send for UserContext
impl Sync for UserContext
impl Unpin for UserContext
impl UnwindSafe for UserContext
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more