Pass implicit PID into syscalls

This commit is contained in:
2025-10-18 12:10:59 +02:00
parent d1d777ec75
commit a5fe64b253
15 changed files with 56 additions and 34 deletions

View File

@ -193,8 +193,12 @@ void hal_syscalldispatch(IntrStackFrame *frame) {
frame->regs.rax = E_BADSYSCALL;
return;
}
int32_t ret = fn(frame, frame->regs.rdi, frame->regs.rsi, frame->regs.rdx,
frame->regs.r10, frame->regs.r8, frame->regs.r9);
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);
if (ret == E_DOSCHEDULING) {
proc_sched((void *)frame);