Fetching buffer arguments from user space.
This commit is contained in:
parent
d38b24a9cb
commit
9366099b28
20 changed files with 405 additions and 82 deletions
|
@ -1,3 +1,5 @@
|
|||
use crate::trap::trap_return;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct TaskContext {
|
||||
ra: usize,
|
||||
|
@ -5,10 +7,9 @@ pub struct TaskContext {
|
|||
}
|
||||
|
||||
impl TaskContext {
|
||||
pub fn goto_restore() -> Self {
|
||||
extern "C" { fn __restore(); }
|
||||
pub fn goto_trap_return() -> Self {
|
||||
Self {
|
||||
ra: __restore as usize,
|
||||
ra: trap_return as usize,
|
||||
s: [0; 12],
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue