Handle backspace for k210/qemu platform && Add lots of user tests.

This commit is contained in:
Yifan Wu 2020-12-11 01:44:07 +08:00
parent 9165e64d1b
commit 244c0ee84d
20 changed files with 361 additions and 35 deletions

View file

@ -42,14 +42,17 @@ pub fn suspend_current_and_run_next() {
schedule(task_cx_ptr);
}
pub fn exit_current_and_run_next() {
pub fn exit_current_and_run_next(exit_code: i32) {
// take from Processor
let task = take_current_task().unwrap();
// **** hold current PCB lock
let mut inner = task.acquire_inner_lock();
// Change status to Zombie
inner.task_status = TaskStatus::Zombie;
// Record exit code
inner.exit_code = exit_code;
// move any child to its parent
// TODO: do not move to its parent but under initproc
// ++++++ hold parent PCB lock here
{