|
|
@ -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])
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|