Stage2: multiple user threads based on uniprocessor, see new added test race_adder and threads.
This commit is contained in:
parent
4fa4e9cab4
commit
a341b338c8
12 changed files with 254 additions and 57 deletions
|
@ -84,11 +84,20 @@ pub fn current_trap_cx() -> &'static mut TrapContext {
|
|||
}
|
||||
|
||||
pub fn current_trap_cx_user_va() -> usize {
|
||||
current_task().unwrap().inner_exclusive_access().res.trap_cx_user_va()
|
||||
current_task()
|
||||
.unwrap()
|
||||
.inner_exclusive_access()
|
||||
.res
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.trap_cx_user_va()
|
||||
}
|
||||
|
||||
pub fn current_kstack_top() -> usize {
|
||||
current_task().unwrap().inner_exclusive_access().res.kstack_top()
|
||||
current_task()
|
||||
.unwrap()
|
||||
.kstack
|
||||
.get_top()
|
||||
}
|
||||
|
||||
pub fn schedule(switched_task_cx_ptr: *mut TaskContext) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue