From dad1d2d7923038e211672e60d0d86688bef3c361 Mon Sep 17 00:00:00 2001 From: Bahadir Balban Date: Wed, 27 Aug 2008 14:52:06 +0300 Subject: [PATCH] When creating a new thread, forgot to set its syscall_args * pointer. --- src/api/thread.c | 10 ++++++++++ src/arch/arm/v5/mm.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/api/thread.c b/src/api/thread.c index 196a5f7..921599f 100644 --- a/src/api/thread.c +++ b/src/api/thread.c @@ -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; diff --git a/src/arch/arm/v5/mm.c b/src/arch/arm/v5/mm.c index 8341b0f..8811fa9 100644 --- a/src/arch/arm/v5/mm.c +++ b/src/arch/arm/v5/mm.c @@ -392,7 +392,7 @@ pgd_table_t *copy_page_tables(pgd_table_t *from) pgd->entry[i] |= PGD_TYPE_COARSE; } } - BUG(); + return pgd; }