From bfed67715df280c2f7575cd63aa65315860bb32c Mon Sep 17 00:00:00 2001 From: zhangxinyu <840317537@qq.com> Date: Wed, 24 May 2023 16:44:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E8=B0=83=E7=94=A8sys=20get=20time?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ch3/user/src/syscall.rs | 6 ++++++ 1 file changed, 6 insertions(+) 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]) +} + +