Use implicitly passed _caller_pid in syscalls

This commit is contained in:
2025-10-18 12:20:43 +02:00
parent a5fe64b253
commit 0e0bff4888
6 changed files with 34 additions and 34 deletions

View File

@ -8,6 +8,7 @@
#include "kprintf.h"
#include "proc/proc.h"
#include "spinlock/spinlock.h"
#include "util/util.h"
#define _MP_MAX 0xff
#define _PATH_MAX VFS_PATH_MAX
@ -35,7 +36,8 @@ int32_t SYSCALL2(sys_fs_openf, opath1, oflags1) {
}
spinlock_acquire(&PROCS.spinlock);
Proc *proc = PROCS.current;
Proc *proc = NULL;
LL_FINDPROP(PROCS.procs, proc, pid, _caller_pid);
spinlock_release(&PROCS.spinlock);
for (size_t i = 0; i < PROC_VFSHANDLES_MAX; i++) {
@ -62,7 +64,8 @@ int32_t SYSCALL1(sys_fs_closef, fsh1) {
}
spinlock_acquire(&PROCS.spinlock);
Proc *proc = PROCS.current;
Proc *proc = NULL;
LL_FINDPROP(PROCS.procs, proc, pid, _caller_pid);
spinlock_release(&PROCS.spinlock);
VfsObj *vobj = proc->vobjs[fsh];
@ -99,7 +102,8 @@ int32_t SYSCALL4(sys_fs_write, fsh1, buffer1, len1, off1) {
}
spinlock_acquire(&PROCS.spinlock);
Proc *proc = PROCS.current;
Proc *proc = NULL;
LL_FINDPROP(PROCS.procs, proc, pid, _caller_pid);
spinlock_release(&PROCS.spinlock);
VfsObj *vobj = proc->vobjs[fsh];
@ -134,7 +138,8 @@ int32_t SYSCALL4(sys_fs_read, fsh1, buffer1, len1, off1) {
}
spinlock_acquire(&PROCS.spinlock);
Proc *proc = PROCS.current;
Proc *proc = NULL;
LL_FINDPROP(PROCS.procs, proc, pid, _caller_pid);
spinlock_release(&PROCS.spinlock);
VfsObj *vobj = proc->vobjs[fsh];