mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 02:43:15 +01:00
When creating a new thread, forgot to set its syscall_args * pointer.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -392,7 +392,7 @@ pgd_table_t *copy_page_tables(pgd_table_t *from)
|
||||
pgd->entry[i] |= PGD_TYPE_COARSE;
|
||||
}
|
||||
}
|
||||
BUG();
|
||||
|
||||
return pgd;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user