|
|
|
@ -27,14 +27,17 @@ fn sbi_call(which: usize, arg0: usize, arg1: usize, arg2: usize) -> usize {
|
|
|
|
|
ret
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// use sbi call to putchar in console (qemu uart handler)
|
|
|
|
|
pub fn console_putchar(c: usize) {
|
|
|
|
|
sbi_call(SBI_CONSOLE_PUTCHAR, c, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// use sbi call to getchar from console (qemu uart handler)
|
|
|
|
|
pub fn console_getchar() -> usize {
|
|
|
|
|
sbi_call(SBI_CONSOLE_GETCHAR, 0, 0, 0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// use sbi call to shutdown the kernel
|
|
|
|
|
pub fn shutdown() -> ! {
|
|
|
|
|
sbi_call(SBI_SHUTDOWN, 0, 0, 0);
|
|
|
|
|
panic!("It should shutdown!");
|
|
|
|
|