mirror of
https://github.com/drasko/codezero.git
synced 2026-01-23 08:13:15 +01:00
Fixed 2 more fork issues
Added setting of spsr for the new task. Added newly created task into mm0's global task list.
This commit is contained in:
@@ -121,6 +121,7 @@ int pager_notify_fork(l4id_t sender, l4id_t parid,
|
||||
memcpy(child->fd, parent->fd, TASK_FILES_MAX * sizeof(int));
|
||||
|
||||
l4_ipc_return(0);
|
||||
printf("%s/%s: Exiting...\n", __TASKNAME__, __FUNCTION__);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -94,6 +94,7 @@ struct task_data_head {
|
||||
};
|
||||
|
||||
struct tcb *find_task(int tid);
|
||||
void task_add_global(struct tcb *t);
|
||||
|
||||
struct initdata;
|
||||
void init_pm(struct initdata *initdata);
|
||||
|
||||
@@ -158,6 +158,10 @@ int do_fork(struct tcb *parent)
|
||||
/* Notify fs0 about forked process */
|
||||
vfs_notify_fork(child, parent);
|
||||
|
||||
/* Add child to global task list */
|
||||
task_add_global(child);
|
||||
|
||||
printf("%s/%s: Starting forked child.\n", __TASKNAME__, __FUNCTION__);
|
||||
/* Start forked child. */
|
||||
l4_thread_control(THREAD_RUN, &ids);
|
||||
|
||||
|
||||
@@ -43,6 +43,12 @@ void print_tasks(void)
|
||||
}
|
||||
}
|
||||
|
||||
void task_add_global(struct tcb *task)
|
||||
{
|
||||
list_add_tail(&task->list, &tcb_head.list);
|
||||
tcb_head.total++;
|
||||
}
|
||||
|
||||
struct tcb *find_task(int tid)
|
||||
{
|
||||
struct tcb *t;
|
||||
@@ -276,8 +282,7 @@ int task_exec(struct vm_file *f, unsigned long task_region_start,
|
||||
return err;
|
||||
|
||||
/* Add the task to the global task list */
|
||||
list_add_tail(&task->list, &tcb_head.list);
|
||||
tcb_head.total++;
|
||||
task_add_global(task);
|
||||
|
||||
/* Add the file to global vm lists */
|
||||
list_del_init(&f->list);
|
||||
|
||||
Reference in New Issue
Block a user