make build BOARD=k210 sucessfully

This commit is contained in:
Yu Chen 2022-06-23 22:23:49 +08:00
parent 8e6f364ecc
commit e7d6406f45
8 changed files with 96 additions and 9 deletions

View file

@ -40,9 +40,13 @@ pub fn console_getchar() -> usize {
sbi_call(SBI_CONSOLE_GETCHAR, 0, 0, 0)
}
#[cfg(feature = "board_qemu")]
use crate::board::QEMUExit;
pub fn shutdown(exit_code: usize) -> ! {
//sbi_call(SBI_SHUTDOWN, exit_code, 0, 0);
#[cfg(feature = "board_k210")]
sbi_call(SBI_SHUTDOWN, exit_code, 0, 0);
#[cfg(feature = "board_qemu")]
crate::board::QEMU_EXIT_HANDLE.exit_failure();
#[cfg(feature = "board_k210")]
panic!("It should shutdown!");
}