Fetching buffer arguments from user space.

This commit is contained in:
Yifan Wu 2020-12-06 13:56:13 +08:00
parent d38b24a9cb
commit 9366099b28
20 changed files with 405 additions and 82 deletions

View file

@ -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],
}
}