From 013e4e5c4638f8e03c75d809b0596ae820dbb87b Mon Sep 17 00:00:00 2001 From: Yifan Wu Date: Wed, 29 Mar 2023 21:16:34 +0800 Subject: [PATCH] fix ch8 --- os/src/task/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/os/src/task/mod.rs b/os/src/task/mod.rs index 4755e7a6..de611f35 100644 --- a/os/src/task/mod.rs +++ b/os/src/task/mod.rs @@ -10,6 +10,7 @@ mod task; use self::id::TaskUserRes; use crate::fs::{open_file, OpenFlags}; +use crate::sbi::shutdown; use alloc::{sync::Arc, vec::Vec}; use lazy_static::*; use manager::fetch_task; @@ -82,10 +83,10 @@ pub fn exit_current_and_run_next(exit_code: i32) { ); if exit_code != 0 { //crate::sbi::shutdown(255); //255 == -1 for err hint - crate::board::QEMU_EXIT_HANDLE.exit_failure(); + shutdown(true); } else { //crate::sbi::shutdown(0); //0 for success hint - crate::board::QEMU_EXIT_HANDLE.exit_success(); + shutdown(false); } } remove_from_pid2process(pid);