aboutsummaryrefslogtreecommitdiff
path: root/src/proc.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-07-07 18:12:55 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-07-07 18:12:55 +0300
commitfe4c623cb9320226866829317cea8ba0c49e7dbc (patch)
tree7ea3723077c72ff7969747a70ece0b94d88d2219 /src/proc.c
parentd592abd8ccc4026c51e196777031eb65c4acc4de (diff)
downloadkmi-fe4c623cb9320226866829317cea8ba0c49e7dbc.tar.gz
kmi-fe4c623cb9320226866829317cea8ba0c49e7dbc.zip
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
Diffstat (limited to 'src/proc.c')
-rw-r--r--src/proc.c5
1 files changed, 1 insertions, 4 deletions
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? */