aboutsummaryrefslogtreecommitdiff
path: root/kernel/features/proc.c
diff options
context:
space:
mode:
authorMarvin Borner2021-01-09 23:31:28 +0100
committerMarvin Borner2021-01-09 23:33:34 +0100
commitff9c7766edded74f4d522484c828b1bdc7dfa96d (patch)
treefc076342222b6eb0c200a9bbb028c7765ed758b2 /kernel/features/proc.c
parent836294b9232c7d63d26db4f87c32cf1420cd856d (diff)
Let's make a procfs for IPC instead
Diffstat (limited to 'kernel/features/proc.c')
-rw-r--r--kernel/features/proc.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/kernel/features/proc.c b/kernel/features/proc.c
index 08f3b8e..93e97f1 100644
--- a/kernel/features/proc.c
+++ b/kernel/features/proc.c
@@ -82,34 +82,6 @@ struct proc *proc_current(void)
return current && current->data ? current->data : NULL;
}
-void proc_send(struct proc *src, struct proc *dest, u32 type, void *data)
-{
- // TODO: Use unique key instead of pid for IPC
- if (!src || !dest)
- return;
- struct proc_message *msg = malloc(sizeof(*msg));
- msg->src = src;
- msg->dest = dest;
- msg->msg = malloc(sizeof(*msg->msg));
- msg->msg->src = (int)src->pid;
- msg->msg->type = (int)type;
- msg->msg->data = data;
- list_add(dest->messages, msg);
- priority_proc = dest;
-}
-
-u32 proc_receive(struct proc *proc, struct message *buf)
-{
- if (proc->messages && proc->messages->head) {
- struct proc_message *msg = proc->messages->head->data;
- list_remove(proc->messages, proc->messages->head);
- memcpy(buf, msg->msg, sizeof(*buf));
- return 1;
- } else {
- return 0;
- }
-}
-
struct proc *proc_from_pid(u32 pid)
{
struct node *iterator = proc_list->head;
@@ -157,7 +129,6 @@ struct proc *proc_make(void)
{
struct proc *proc = malloc(sizeof(*proc));
proc->pid = current_pid++;
- proc->messages = list_new();
proc->state = PROC_RUNNING;
if (current)