Use implicitly passed _caller_pid in syscalls
This commit is contained in:
@ -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];
|
||||
|
||||
Reference in New Issue
Block a user