[kernel] Have process_start syscall take a list of handles

This also prompted a change of the process initialization protocol to
allow handles to get typed, and changing to marking them as just
self/other handls. This also means exposing the object type enum to
userspace.
This commit is contained in:
Justin C. Miller
2021-01-23 20:34:03 -08:00
parent c0f304559f
commit 16b9d4fd8b
10 changed files with 59 additions and 44 deletions

View File

@@ -16,8 +16,18 @@ process_create(j6_handle_t *handle)
}
j6_status_t
process_start(j6_handle_t *handle, uintptr_t entrypoint)
process_start(j6_handle_t handle, uintptr_t entrypoint, j6_handle_t *handles, size_t handle_count)
{
process &p = process::current();
process *c = get_handle<process>(handle);
if (handle_count && !handles)
return j6_err_invalid_arg;
for (size_t i = 0; i < handle_count; ++i) {
kobject *o = p.lookup_handle(handles[i]);
if (o) c->add_handle(o);
}
return j6_err_nyi;
}