From 67c9dc06ca0b5aec6430d50af9444bbe85b6deb5 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 16 Apr 2022 20:27:46 +0300 Subject: initial thread id handling + At least initial in the sense that this seems like the smartest way to handle things, that is. --- common/proc.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'common/proc.c') diff --git a/common/proc.c b/common/proc.c index 9f89b7f..e0b8c70 100644 --- a/common/proc.c +++ b/common/proc.c @@ -27,17 +27,13 @@ static vm_t setup_proc_stack(struct tcb *t, size_t bytes) stat_t init_proc(void *fdt, struct vm_branch *b) { + init_tcbs(); + /* todo: cleanup or something */ - struct tcb *t = (struct tcb *)alloc_page(BASE_PAGE, 0); + struct tcb *t = new_thread(); if (!t) return ERR_OOMEM; - - memset(t, 0, sizeof(struct tcb)); t->b_r = b; - t->pid = 0; - t->tid = 0; - - threads_insert(t); init_uvmem(t, UVMEM_START, UVMEM_END); -- cgit v1.3