添加用户系统调用sys get time

ch3
zhangxinyu 2 years ago
parent 43cd467d9f
commit bfed67715d

@ -3,6 +3,7 @@ use core::arch::asm;
const SYSCALL_WRITE: usize = 64; const SYSCALL_WRITE: usize = 64;
const SYSCALL_EXIT: usize = 93; const SYSCALL_EXIT: usize = 93;
const SYSCALL_YIELD: usize = 124; const SYSCALL_YIELD: usize = 124;
const SYSCALL_GET_TIME: usize = 169;
fn syscall(id: usize, args: [usize; 3]) -> isize { fn syscall(id: usize, args: [usize; 3]) -> isize {
@ -33,3 +34,8 @@ pub fn sys_yield() {
syscall(SYSCALL_YIELD, [0, 0, 0]); syscall(SYSCALL_YIELD, [0, 0, 0]);
} }
pub fn sys_get_time() -> isize {
syscall(SYSCALL_GET_TIME, [0, 0, 0])
}

Loading…
Cancel
Save