Rename event pipes to broadcast pipes
This commit is contained in:
@ -101,7 +101,7 @@ Proc *proc_spawnkern(void (*ent)(void), char *name) {
|
||||
proc->platformdata.cr3 = hal_vmm_current_cr3();
|
||||
proc->state = PROC_READY;
|
||||
proc->pid = pids++;
|
||||
spinlock_init(&proc->eventpipes_spinlock);
|
||||
spinlock_init(&proc->bcast_pipes.spinlock);
|
||||
|
||||
return proc;
|
||||
}
|
||||
@ -167,7 +167,7 @@ Proc *proc_spawnuser(char *mountpoint, char *path) {
|
||||
proc->platformdata.trapframe.rip = aux.entry;
|
||||
proc->state = PROC_READY;
|
||||
proc->pid = pids++;
|
||||
spinlock_init(&proc->eventpipes_spinlock);
|
||||
spinlock_init(&proc->bcast_pipes.spinlock);
|
||||
|
||||
return proc;
|
||||
}
|
||||
|
@ -45,10 +45,11 @@ typedef struct Proc {
|
||||
|
||||
VfsObj *vobjs[PROC_VFSHANDLES_MAX];
|
||||
uint64_t vobjcnt;
|
||||
|
||||
IpcPipe *pipes[PROC_PIPEHANDLES_MAX];
|
||||
IpcPipe *eventpipes;
|
||||
SpinLock eventpipes_spinlock;
|
||||
struct {
|
||||
IpcPipe *list;
|
||||
SpinLock spinlock;
|
||||
} bcast_pipes;
|
||||
} Proc;
|
||||
|
||||
typedef struct {
|
||||
|
@ -13,7 +13,7 @@ Ps2KbFastBuf PS2KB_BUF;
|
||||
void ps2kbproc_init(Proc *proc) {
|
||||
PS2KBPROC = proc;
|
||||
|
||||
PS2KBPROC->eventpipes = NULL;
|
||||
PS2KBPROC->bcast_pipes.list = NULL;
|
||||
|
||||
PS2KB_BUF.rbuf.buffer = dlmalloc(IPC_PIPE_MAX);
|
||||
PS2KB_BUF.rbuf.cap = IPC_PIPE_MAX;
|
||||
@ -33,13 +33,13 @@ void ps2kbproc_fn(void) {
|
||||
}
|
||||
spinlock_release(&PS2KB_BUF.spinlock);
|
||||
if (i > 0) {
|
||||
spinlock_acquire(&PS2KBPROC->eventpipes_spinlock);
|
||||
IpcPipe *head = PS2KBPROC->eventpipes;
|
||||
spinlock_acquire(&PS2KBPROC->bcast_pipes.spinlock);
|
||||
IpcPipe *head = PS2KBPROC->bcast_pipes.list;
|
||||
while (head != NULL) {
|
||||
ipc_pipewrite(head, (uint8_t *)&kbchr, sizeof(kbchr));
|
||||
head = head->next;
|
||||
}
|
||||
spinlock_release(&PS2KBPROC->eventpipes_spinlock);
|
||||
spinlock_release(&PS2KBPROC->bcast_pipes.spinlock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user