add VIRT_TEST support for qemu exit with exit_code, for CI autotest

This commit is contained in:
Yu Chen 2022-05-15 17:34:24 +08:00
parent a8e8644865
commit f25fe0431c
3 changed files with 94 additions and 6 deletions

View file

@ -39,7 +39,9 @@ pub fn console_getchar() -> usize {
sbi_call(SBI_CONSOLE_GETCHAR, 0, 0, 0)
}
use crate::board::QEMUExit;
pub fn shutdown(exit_code: usize) -> ! {
sbi_call(SBI_SHUTDOWN, exit_code, 0, 0);
//sbi_call(SBI_SHUTDOWN, exit_code, 0, 0);
crate::board::QEMU_EXIT_HANDLE.exit_failure();
panic!("It should shutdown!");
}