Add sys_yield tests and compile them to different location.
This commit is contained in:
parent
1414d05325
commit
4e8059e222
12 changed files with 99 additions and 57 deletions
|
@ -2,6 +2,8 @@ pub const STDOUT: usize = 1;
|
|||
|
||||
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 {
|
||||
let mut ret: isize;
|
||||
|
@ -23,3 +25,11 @@ pub fn sys_write(fd: usize, buffer: &[u8]) -> isize {
|
|||
pub fn sys_exit(xstate: i32) -> isize {
|
||||
syscall(SYSCALL_EXIT, [xstate as usize, 0, 0])
|
||||
}
|
||||
|
||||
pub fn sys_yield() -> isize {
|
||||
syscall(SYSCALL_YIELD, [0, 0, 0])
|
||||
}
|
||||
|
||||
pub fn sys_get_time() -> isize {
|
||||
syscall(SYSCALL_GET_TIME, [0, 0, 0])
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue