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

@ -193,9 +193,7 @@ void hal_syscalldispatch(IntrStackFrame *frame) {
frame->regs.rax = E_BADSYSCALL;
return;
}
spinlock_acquire(&PROCS.spinlock);
uint64_t calling_proc_pid = PROCS.current->pid;
spinlock_release(&PROCS.spinlock);
hal_intr_enable();
int32_t ret = fn(frame, calling_proc_pid, frame->regs.rdi, frame->regs.rsi, frame->regs.rdx,
frame->regs.r10, frame->regs.r8, frame->regs.r9);