thread: remove struct proc abstraction
struct proc was a redundant abstraction. everything can be tracked by just threads Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
20905ec95f
commit
e41877b268
16 changed files with 646 additions and 120 deletions
10
init/main.c
10
init/main.c
|
|
@ -76,7 +76,7 @@ static void kmain()
|
|||
/* "layer 2" kernel requirements */
|
||||
devfs_init();
|
||||
device_layer_init();
|
||||
proc_init();
|
||||
thread_init();
|
||||
|
||||
/* init main fallback tty */
|
||||
struct tty *serial_tty = NULL;
|
||||
|
|
@ -108,17 +108,17 @@ static void kmain()
|
|||
if (res < 0)
|
||||
panic("failed to read /bin/utest: %s\n", strerror(-res));
|
||||
|
||||
struct proc *init_proc = proc_create(NULL);
|
||||
uaddr_t entry = proc_load_file(init_buf, init_proc);
|
||||
struct thread *init_thread = thread_create();
|
||||
uaddr_t entry = thread_load_file(init_buf, init_thread);
|
||||
|
||||
if ((ssize_t)entry < 0)
|
||||
panic("failed to load /bin/utest: %s\n", strerror(-(ssize_t)entry));
|
||||
|
||||
kernel_init_ready = true;
|
||||
|
||||
init_proc->main_thread->state = PROC_STATE_RUNNING;
|
||||
init_thread->state = THREAD_STATE_RUNNING;
|
||||
|
||||
enter_userspace_init(init_proc->main_thread, entry);
|
||||
enter_userspace_init(init_thread, entry);
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue