Pass implicit PID into syscalls
This commit is contained in:
@ -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);
|
||||
|
||||
@ -62,7 +62,7 @@
|
||||
.endm
|
||||
|
||||
.macro _vecintr_bodygen
|
||||
// cli
|
||||
cli
|
||||
_push_regs
|
||||
cld
|
||||
movq %rsp, %rdi
|
||||
|
||||
Reference in New Issue
Block a user