Support signal mechanism for ch8(only works on signal-thread apps)
This commit is contained in:
parent
59f13cb536
commit
26bc01f3bc
17 changed files with 235 additions and 17 deletions
|
@ -9,6 +9,7 @@ const SYSCALL_WRITE: usize = 64;
|
|||
const SYSCALL_EXIT: usize = 93;
|
||||
const SYSCALL_SLEEP: usize = 101;
|
||||
const SYSCALL_YIELD: usize = 124;
|
||||
const SYSCALL_KILL: usize = 129;
|
||||
const SYSCALL_GET_TIME: usize = 169;
|
||||
const SYSCALL_GETPID: usize = 172;
|
||||
const SYSCALL_FORK: usize = 220;
|
||||
|
@ -81,6 +82,10 @@ pub fn sys_yield() -> isize {
|
|||
syscall(SYSCALL_YIELD, [0, 0, 0])
|
||||
}
|
||||
|
||||
pub fn sys_kill(pid: usize, signal: i32) -> isize {
|
||||
syscall(SYSCALL_KILL, [pid, signal as usize, 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