sched: task: optional handle_table pointer can now be passed to task_create
This commit is contained in:
+9
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user