From 0117080b61595f11d8b3c5c4a12751e9f5bba929 Mon Sep 17 00:00:00 2001 From: kamkow1 Date: Sat, 4 Oct 2025 14:43:24 +0200 Subject: [PATCH] Remove bcast pipes --- kernel/proc/proc.c | 1 - kernel/proc/proc.h | 5 ----- kernel/syscall/ipcpipe.c | 33 --------------------------------- share/sysdefs/ipcpipe.h | 1 - 4 files changed, 40 deletions(-) diff --git a/kernel/proc/proc.c b/kernel/proc/proc.c index 3ed21ba..1259191 100644 --- a/kernel/proc/proc.c +++ b/kernel/proc/proc.c @@ -139,7 +139,6 @@ Proc *proc_spawnuser(char *mountpoint, char *path) { proc->state = PROC_EMBRYO; proc->pid = pids++; proc->mman_map_base = PROC_MMAN_MAP_BASE; - spinlock_init(&proc->bcast_pipes.spinlock); spinlock_init(&proc->pipes_spinlock); spinlock_init(&proc->devs_spinlock); diff --git a/kernel/proc/proc.h b/kernel/proc/proc.h index a8ac3b8..6a9cb23 100644 --- a/kernel/proc/proc.h +++ b/kernel/proc/proc.h @@ -60,11 +60,6 @@ typedef struct Proc { IpcPipe *pipes[PROC_PIPEHANDLES_MAX]; SpinLock pipes_spinlock; - struct { - IpcPipe *list; - SpinLock spinlock; - } bcast_pipes; - Dev *devs[PROC_DEVHANDLES_MAX]; SpinLock devs_spinlock; diff --git a/kernel/syscall/ipcpipe.c b/kernel/syscall/ipcpipe.c index e2c4ba3..27649ca 100644 --- a/kernel/syscall/ipcpipe.c +++ b/kernel/syscall/ipcpipe.c @@ -122,39 +122,6 @@ int32_t SYSCALL5(sys_ipcpipe, pid1, pipenum1, cmd1, buffer1, len1) { ret = ipc_piperead(pipe, buffer, len1); } break; - case IPCPIPE_ADD_BCAST: { - if (pipenum >= PROC_PIPEHANDLES_MAX) { - ret = E_NOMEMORY; - goto done; - } - - spinlock_acquire(&proc->pipes_spinlock); - IpcPipe *pipe = proc->pipes[pipenum]; - spinlock_release(&proc->pipes_spinlock); - - if (pipe == NULL) { - ret = E_INVALIDARGUMENT; - goto done; - } - - uint64_t pid2 = len1; - - Proc *proc2 = NULL; - spinlock_acquire(&PROCS.spinlock); - LL_FINDPROP(PROCS.procs, proc2, pid, pid2); - spinlock_release(&PROCS.spinlock); - - if (proc2 == NULL) { - ret = E_INVALIDARGUMENT; - goto done; - } - - spinlock_acquire(&proc2->bcast_pipes.spinlock); - LL_APPEND(proc2->bcast_pipes.list, pipe); - spinlock_release(&proc2->bcast_pipes.spinlock); - - ret = E_OK; - } break; case IPCPIPE_REPLACE: { if (pipenum >= PROC_PIPEHANDLES_MAX) { ret = E_NOMEMORY; diff --git a/share/sysdefs/ipcpipe.h b/share/sysdefs/ipcpipe.h index c8ba754..0c836ea 100644 --- a/share/sysdefs/ipcpipe.h +++ b/share/sysdefs/ipcpipe.h @@ -12,7 +12,6 @@ #define IPCPIPE_MAKE 0 #define IPCPIPE_READ 1 #define IPCPIPE_WRITE 2 -#define IPCPIPE_ADD_BCAST 3 #define IPCPIPE_REPLACE 4 #define IPCPIPE_DELETE 5