From f723ee06a975d93fcfc38de23add2d8b731b15df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E5=87=AF=E5=A4=AB?= Date: Mon, 14 Mar 2022 16:37:10 +0800 Subject: [PATCH] Update docs --- os/src/sbi.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/os/src/sbi.rs b/os/src/sbi.rs index 90ba2c2a..f66d9751 100644 --- a/os/src/sbi.rs +++ b/os/src/sbi.rs @@ -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!");