Struct trapframe::UserContext[][src]

#[repr(C)]pub struct UserContext {
    pub general: GeneralRegs,
    pub trap_num: usize,
    pub error_code: usize,
}

User space context

Fields

general: GeneralRegstrap_num: usizeerror_code: usize

Implementations

impl UserContext[src]

pub fn run_fncall(&mut self)[src]

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.

impl UserContext[src]

pub fn get_syscall_num(&self) -> usize[src]

Get number of syscall

pub fn get_syscall_ret(&self) -> usize[src]

Get return value of syscall

pub fn set_syscall_ret(&mut self, ret: usize)[src]

Set return value of syscall

pub fn get_syscall_args(&self) -> [usize; 6][src]

Get syscall args

pub fn set_ip(&mut self, ip: usize)[src]

Set instruction pointer

pub fn set_sp(&mut self, sp: usize)[src]

Set stack pointer

pub fn get_sp(&self) -> usize[src]

Get stack pointer

pub fn set_tls(&mut self, tls: usize)[src]

Set tls pointer

Trait Implementations

impl Clone for UserContext[src]

impl Copy for UserContext[src]

impl Debug for UserContext[src]

impl Default for UserContext[src]

impl Eq for UserContext[src]

impl PartialEq<UserContext> for UserContext[src]

impl StructuralEq for UserContext[src]

impl StructuralPartialEq for UserContext[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.