Remove bcast pipes
This commit is contained in:
@ -139,7 +139,6 @@ Proc *proc_spawnuser(char *mountpoint, char *path) {
|
|||||||
proc->state = PROC_EMBRYO;
|
proc->state = PROC_EMBRYO;
|
||||||
proc->pid = pids++;
|
proc->pid = pids++;
|
||||||
proc->mman_map_base = PROC_MMAN_MAP_BASE;
|
proc->mman_map_base = PROC_MMAN_MAP_BASE;
|
||||||
spinlock_init(&proc->bcast_pipes.spinlock);
|
|
||||||
spinlock_init(&proc->pipes_spinlock);
|
spinlock_init(&proc->pipes_spinlock);
|
||||||
spinlock_init(&proc->devs_spinlock);
|
spinlock_init(&proc->devs_spinlock);
|
||||||
|
|
||||||
|
@ -60,11 +60,6 @@ typedef struct Proc {
|
|||||||
IpcPipe *pipes[PROC_PIPEHANDLES_MAX];
|
IpcPipe *pipes[PROC_PIPEHANDLES_MAX];
|
||||||
SpinLock pipes_spinlock;
|
SpinLock pipes_spinlock;
|
||||||
|
|
||||||
struct {
|
|
||||||
IpcPipe *list;
|
|
||||||
SpinLock spinlock;
|
|
||||||
} bcast_pipes;
|
|
||||||
|
|
||||||
Dev *devs[PROC_DEVHANDLES_MAX];
|
Dev *devs[PROC_DEVHANDLES_MAX];
|
||||||
SpinLock devs_spinlock;
|
SpinLock devs_spinlock;
|
||||||
|
|
||||||
|
@ -122,39 +122,6 @@ int32_t SYSCALL5(sys_ipcpipe, pid1, pipenum1, cmd1, buffer1, len1) {
|
|||||||
|
|
||||||
ret = ipc_piperead(pipe, buffer, len1);
|
ret = ipc_piperead(pipe, buffer, len1);
|
||||||
} break;
|
} 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: {
|
case IPCPIPE_REPLACE: {
|
||||||
if (pipenum >= PROC_PIPEHANDLES_MAX) {
|
if (pipenum >= PROC_PIPEHANDLES_MAX) {
|
||||||
ret = E_NOMEMORY;
|
ret = E_NOMEMORY;
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
#define IPCPIPE_MAKE 0
|
#define IPCPIPE_MAKE 0
|
||||||
#define IPCPIPE_READ 1
|
#define IPCPIPE_READ 1
|
||||||
#define IPCPIPE_WRITE 2
|
#define IPCPIPE_WRITE 2
|
||||||
#define IPCPIPE_ADD_BCAST 3
|
|
||||||
#define IPCPIPE_REPLACE 4
|
#define IPCPIPE_REPLACE 4
|
||||||
#define IPCPIPE_DELETE 5
|
#define IPCPIPE_DELETE 5
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user