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

@ -15,9 +15,7 @@ int32_t SYSCALL4(sys_ipc_piperead, pid1, pipenum1, buffer1, len1) {
int32_t ret = E_OK;
if (pid == (uint64_t)-1) {
spinlock_acquire(&PROCS.spinlock);
pid = PROCS.current->pid;
spinlock_release(&PROCS.spinlock);
pid = _caller_pid;
}
spinlock_acquire(&PROCS.spinlock);
@ -61,9 +59,7 @@ int32_t SYSCALL4(sys_ipc_pipewrite, pid1, pipenum1, buffer1, len1) {
int32_t ret = E_OK;
if (pid == (uint64_t)-1) {
spinlock_acquire(&PROCS.spinlock);
pid = PROCS.current->pid;
spinlock_release(&PROCS.spinlock);
pid = _caller_pid;
}
spinlock_acquire(&PROCS.spinlock);
@ -106,7 +102,8 @@ int32_t SYSCALL1(sys_ipc_pipemake, pipenum1) {
int32_t ret = E_OK;
spinlock_acquire(&PROCS.spinlock);
Proc *proc = PROCS.current;
Proc *proc = NULL;
LL_FINDPROP(PROCS.procs, proc, pid, _caller_pid);
spinlock_release(&PROCS.spinlock);
if (pipenum >= PROC_PIPEHANDLES_MAX) {
@ -147,7 +144,8 @@ int32_t SYSCALL1(sys_ipc_pipedelete, pipenum1) {
int32_t ret = E_OK;
spinlock_acquire(&PROCS.spinlock);
Proc *proc = PROCS.current;
Proc *proc = NULL;
LL_FINDPROP(PROCS.procs, proc, pid, _caller_pid);
spinlock_release(&PROCS.spinlock);
if (pipenum >= PROC_PIPEHANDLES_MAX) {
@ -174,9 +172,7 @@ int32_t SYSCALL4(sys_ipc_pipeconnect, pid1, pipenum1, pid2, pipenum2) {
int32_t ret = E_OK;
if (pid == (uint64_t)-1) {
spinlock_acquire(&PROCS.spinlock);
pid = PROCS.current->pid;
spinlock_release(&PROCS.spinlock);
pid = _caller_pid;
}
spinlock_acquire(&PROCS.spinlock);