This commit is contained in:
Yifan Wu 2023-03-29 21:16:34 +08:00
parent dccfc54f61
commit 013e4e5c46

View File

@ -10,6 +10,7 @@ mod task;
use self::id::TaskUserRes; use self::id::TaskUserRes;
use crate::fs::{open_file, OpenFlags}; use crate::fs::{open_file, OpenFlags};
use crate::sbi::shutdown;
use alloc::{sync::Arc, vec::Vec}; use alloc::{sync::Arc, vec::Vec};
use lazy_static::*; use lazy_static::*;
use manager::fetch_task; use manager::fetch_task;
@ -82,10 +83,10 @@ pub fn exit_current_and_run_next(exit_code: i32) {
); );
if exit_code != 0 { if exit_code != 0 {
//crate::sbi::shutdown(255); //255 == -1 for err hint //crate::sbi::shutdown(255); //255 == -1 for err hint
crate::board::QEMU_EXIT_HANDLE.exit_failure(); shutdown(true);
} else { } else {
//crate::sbi::shutdown(0); //0 for success hint //crate::sbi::shutdown(0); //0 for success hint
crate::board::QEMU_EXIT_HANDLE.exit_success(); shutdown(false);
} }
} }
remove_from_pid2process(pid); remove_from_pid2process(pid);