sched: task: optional handle_table pointer can now be passed to task_create

This commit is contained in:
2026-04-19 20:04:18 +01:00
parent b52890d842
commit 9a9b0f63ba
4 changed files with 19 additions and 6 deletions
+9 -2
View File
@@ -171,7 +171,10 @@ struct task *task_alloc(void)
return t;
}
struct task *task_create(const char *name, size_t name_len)
struct task *task_create(
const char *name,
size_t name_len,
struct handle_table *handles)
{
struct task *task = task_alloc();
if (!task) {
@@ -191,9 +194,13 @@ struct task *task_create(const char *name, size_t name_len)
VM_USER_LIMIT,
&task->t_address_space);
if (!handles) {
handles = handle_table_create();
}
task->t_address_space->s_pmap = pmap;
task->t_state = TASK_RUNNING;
task->t_handles = handle_table_create();
task->t_handles = handles;
if (name) {
name_len = MIN(name_len, sizeof task->t_name - 1);