update github CI for autotest

This commit is contained in:
Yu Chen 2022-05-15 12:03:05 +08:00
parent 0d9dd75a57
commit 80503e80ee
6 changed files with 115 additions and 55 deletions

View file

@ -18,7 +18,7 @@ fn panic(info: &PanicInfo) -> ! {
unsafe {
backtrace();
}
shutdown()
shutdown(255)
}
unsafe fn backtrace() {

View file

@ -39,7 +39,7 @@ pub fn console_getchar() -> usize {
sbi_call(SBI_CONSOLE_GETCHAR, 0, 0, 0)
}
pub fn shutdown() -> ! {
pub fn shutdown(exit_code: usize) -> ! {
sbi_call(SBI_SHUTDOWN, 0, 0, 0);
panic!("It should shutdown!");
}

View file

@ -74,8 +74,15 @@ pub fn exit_current_and_run_next(exit_code: i32) {
if tid == 0 {
let pid = process.getpid();
if pid == IDLE_PID {
println!("[kernel] Idle process exit ...");
crate::sbi::shutdown();
println!(
"[kernel] Idle process exit with exit_code {} ...",
exit_code
);
if exit_code != 0 {
crate::sbi::shutdown(255); //255 == -1 for err hint
} else {
crate::sbi::shutdown(0); //0 for success hint
}
}
remove_from_pid2process(pid);
let mut process_inner = process.inner_exclusive_access();