sched: task: implement task creation flags

This commit is contained in:
2026-04-30 19:06:46 +01:00
parent 562b856488
commit 02a44f67b9
5 changed files with 26 additions and 22 deletions
+5 -14
View File
@@ -53,6 +53,7 @@ kern_status_t sys_task_self(kern_handle_t *out)
kern_status_t sys_task_create(
kern_handle_t parent_handle,
task_flags_t task_flags,
const char *name,
size_t name_len,
kern_handle_t *out_task,
@@ -124,7 +125,7 @@ kern_status_t sys_task_create(
task_unlock_irqrestore(self, flags);
struct task *child = task_create(name, name_len, NULL);
struct task *child = task_create(parent, task_flags, name, name_len);
if (!child) {
object_unref(parent_obj);
@@ -468,14 +469,6 @@ kern_status_t sys_task_duplicate(
unsigned long flags;
task_lock_irqsave(self, &flags);
struct handle_table *child_handle_table = NULL;
status = handle_table_duplicate(self->t_handles, &child_handle_table);
if (status != KERN_OK) {
task_unlock_irqrestore(self, flags);
put_current_task(self);
return status;
}
struct handle *child_handle_slot = NULL, *space_handle_slot = NULL;
kern_handle_t child_handle, space_handle;
status = handle_table_alloc_handle(
@@ -484,7 +477,6 @@ kern_status_t sys_task_duplicate(
&child_handle_slot,
&child_handle);
if (status != KERN_OK) {
handle_table_destroy(child_handle_table);
task_unlock_irqrestore(self, flags);
put_current_task(self);
return status;
@@ -496,7 +488,6 @@ kern_status_t sys_task_duplicate(
&space_handle_slot,
&space_handle);
if (status != KERN_OK) {
handle_table_destroy(child_handle_table);
handle_table_free_handle(self->t_handles, child_handle);
task_unlock_irqrestore(self, flags);
put_current_task(self);
@@ -504,11 +495,11 @@ kern_status_t sys_task_duplicate(
}
struct task *new_task = task_create(
self,
TASK_F_CLONE_ALL_HANDLES,
self->t_name,
strlen(self->t_name),
child_handle_table);
strlen(self->t_name));
if (!new_task) {
handle_table_destroy(child_handle_table);
put_current_task(self);
return KERN_NO_MEMORY;
}