When creating a new thread, forgot to set its syscall_args * pointer.

This commit is contained in:
Bahadir Balban
2008-08-27 14:52:06 +03:00
parent f1b3a9b95d
commit dad1d2d792
2 changed files with 11 additions and 1 deletions

View File

@@ -89,10 +89,20 @@ int arch_setup_new_thread(struct ktcb *new, struct ktcb *orig)
(void *)((unsigned long)orig + syscall_context_offset),
sizeof(syscall_context_t));
/*
* Set new thread's syscall_regs offset since its
* normally set during syscall entry
*/
new->syscall_regs = (syscall_context_t *)
((unsigned long)new + syscall_context_offset);
/*
* Modify the return register value with 0 to ensure new thread
* returns with that value. This is a POSIX requirement and enforces
* policy on the microkernel, but it is currently the best solution.
*
* A cleaner but slower way would be the pager setting child registers
* via exchanges_registers() and start the child thread afterwards.
*/
new->syscall_regs->r0 = 0;

View File

@@ -392,7 +392,7 @@ pgd_table_t *copy_page_tables(pgd_table_t *from)
pgd->entry[i] |= PGD_TYPE_COARSE;
}
}
BUG();
return pgd;
}