From 2919b14ef31b4f18f3cfbc5669b93687d788c9c6 Mon Sep 17 00:00:00 2001 From: Yifan Wu Date: Wed, 29 Mar 2023 20:51:50 +0800 Subject: [PATCH] fix ch5 --- os/src/task/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/os/src/task/mod.rs b/os/src/task/mod.rs index 569cf74..00a056d 100644 --- a/os/src/task/mod.rs +++ b/os/src/task/mod.rs @@ -59,8 +59,6 @@ pub fn suspend_current_and_run_next() { /// pid of usertests app in make run TEST=1 pub const IDLE_PID: usize = 0; -use crate::board::QEMUExit; - /// Exit the current 'Running' task and run the next task in task list. pub fn exit_current_and_run_next(exit_code: i32) { // take from Processor @@ -74,10 +72,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) } }