diff --git a/ch3/user/src/syscall.rs b/ch3/user/src/syscall.rs index 0c9f3e1..831658e 100644 --- a/ch3/user/src/syscall.rs +++ b/ch3/user/src/syscall.rs @@ -3,6 +3,7 @@ use core::arch::asm; const SYSCALL_WRITE: usize = 64; const SYSCALL_EXIT: usize = 93; const SYSCALL_YIELD: usize = 124; +const SYSCALL_GET_TIME: usize = 169; fn syscall(id: usize, args: [usize; 3]) -> isize { @@ -33,3 +34,8 @@ pub fn sys_yield() { syscall(SYSCALL_YIELD, [0, 0, 0]); } +pub fn sys_get_time() -> isize { + syscall(SYSCALL_GET_TIME, [0, 0, 0]) +} + +