mirror of
https://github.com/drasko/codezero.git
synced 2026-01-24 00:33:14 +01:00
clone() call working. Tested exit(), clone() and fork() mixture running about 22 threads, processes.
This commit is contained in:
@@ -122,10 +122,14 @@ int do_clone(struct tcb *parent, unsigned long child_stack, unsigned int flags)
|
||||
child->stack_end = child_stack;
|
||||
child->stack_start = 0;
|
||||
|
||||
/* Set child's stack pointer */
|
||||
memset(&exregs, 0, sizeof(exregs));
|
||||
|
||||
/* Set child's stack pointer */
|
||||
exregs_set_stack(&exregs, child_stack);
|
||||
|
||||
/* Set child's clone return value to 0 */
|
||||
exregs_set_mr(&exregs, MR_RETURN, 0);
|
||||
|
||||
/* Do the actual exregs call to c0 */
|
||||
if ((err = l4_exchange_registers(&exregs, child->tid)) < 0)
|
||||
BUG();
|
||||
|
||||
@@ -61,13 +61,9 @@ struct tcb *find_task(int tid)
|
||||
{
|
||||
struct tcb *t;
|
||||
|
||||
list_for_each_entry(t, &global_tasks.list, list) {
|
||||
/* A temporary precaution */
|
||||
BUG_ON(t->tid != t->spid);
|
||||
if (t->tid == tid) {
|
||||
list_for_each_entry(t, &global_tasks.list, list)
|
||||
if (t->tid == tid)
|
||||
return t;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user