Implement schedsleep() syscall to sleep a process for a given time

This commit is contained in:
2025-11-02 16:46:37 +01:00
parent 179c4b98e2
commit 0f93aa2a81
9 changed files with 29 additions and 6 deletions

View File

@ -9,3 +9,9 @@
int32_t SYSCALL0(sys_schedrelease) {
return E_DOSCHEDULING;
}
int32_t SYSCALL1(sys_schedsleep, ms1) {
uint32_t ms = (uint32_t)ms1;
hal_wait(ms);
return E_OK;
}

View File

@ -5,5 +5,6 @@
#include "syscall.h"
int32_t SYSCALL0(sys_schedrelease);
int32_t SYSCALL1(sys_schedsleep, ms1);
#endif // SYSCALL_SCHED_H_

View File

@ -27,6 +27,7 @@ SyscallFn SYSCALL_TABLE[SYSCALLS_MAX] = {
[SYS_MMAN_UNMAP] = &sys_mman_unmap,
[SYS_SCHEDRELEASE] = &sys_schedrelease,
[SYS_SCHEDSLEEP] = &sys_schedsleep,
[SYS_RAND] = &sys_rand,