|
|
@ -2,6 +2,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;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn syscall(id: usize, args: [usize; 3]) -> isize {
|
|
|
|
fn syscall(id: usize, args: [usize; 3]) -> isize {
|
|
|
@ -28,3 +29,7 @@ pub fn sys_exit(exit_code: i32) -> isize {
|
|
|
|
syscall(SYSCALL_EXIT, [exit_code as usize, 0, 0])
|
|
|
|
syscall(SYSCALL_EXIT, [exit_code as usize, 0, 0])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn sys_yield() {
|
|
|
|
|
|
|
|
syscall(SYSCALL_YIELD, [0, 0, 0]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|