From fe4c623cb9320226866829317cea8ba0c49e7dbc Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sun, 7 Jul 2024 18:12:55 +0300 Subject: make executable entrypoint universal callback + Effectively means that all executables can be called into, but if an exe doesn't want to deal with anyone else it should just set a flag like `not_really_a_server` or whatever --- src/proc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/proc.c') diff --git a/src/proc.c b/src/proc.c index eaa25d8..09dcc5f 100644 --- a/src/proc.c +++ b/src/proc.c @@ -24,6 +24,7 @@ stat_t prepare_proc(struct tcb *t, vm_t bin, vm_t interp) if (!entry) return ERR_INVAL; + t->callback = entry; alloc_stack(t); set_thread(t); set_return(t, entry); @@ -61,10 +62,6 @@ stat_t init_proc(void *fdt, vm_t *proc_fdt, vm_t *proc_initrd) stat_t ret = prepare_proc(t, get_init_base(fdt), 0); assert(ret == OK); - /** In the init process, can the entry be the callback? Is that too - * unergonomic? */ - t->callback = t->exec; - /** \todo start one thread per core, with special handling for init in * that each thread starts at the entry point of init? */ -- cgit v1.3