add #![deny(missing_docs)] AND #![deny(warnings)] in main.rs, and add more comments

This commit is contained in:
Yu Chen 2022-03-26 23:00:04 +08:00
parent 5946903948
commit 139fbc637a
9 changed files with 42 additions and 14 deletions

View file

@ -3,17 +3,20 @@
use crate::task::{exit_current_and_run_next, suspend_current_and_run_next};
use crate::timer::get_time_ms;
/// task exits and submit an exit code
pub fn sys_exit(exit_code: i32) -> ! {
println!("[kernel] Application exited with code {}", exit_code);
exit_current_and_run_next();
panic!("Unreachable in sys_exit!");
}
/// current task gives up resources for other tasks
pub fn sys_yield() -> isize {
suspend_current_and_run_next();
0
}
/// get current time
pub fn sys_get_time() -> isize {
get_time_ms() as isize
}