mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-29 05:04:50 +00:00
Setup the return values for a child process in the trapframe when we setup
the rest of the trapframe instead of doing it in fork_return().
This commit is contained in:
parent
625c76db3a
commit
0d54b9d12c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=71528
|
@ -160,6 +160,10 @@ cpu_fork(p1, p2, flags)
|
|||
((int)p2->p_addr + UPAGES * PAGE_SIZE - 16) - 1;
|
||||
bcopy(p1->p_md.md_regs, p2->p_md.md_regs, sizeof(*p2->p_md.md_regs));
|
||||
|
||||
p2->p_md.md_regs->tf_eax = 0; /* Child returns zero */
|
||||
p2->p_md.md_regs->tf_eflags &= ~PSL_C; /* success */
|
||||
p2->p_md.md_regs->tf_edx = 1;
|
||||
|
||||
/*
|
||||
* Set registers for trampoline to user mode. Leave space for the
|
||||
* return address on stack. These are the kernel mode register values.
|
||||
|
|
|
@ -160,6 +160,10 @@ cpu_fork(p1, p2, flags)
|
|||
((int)p2->p_addr + UPAGES * PAGE_SIZE - 16) - 1;
|
||||
bcopy(p1->p_md.md_regs, p2->p_md.md_regs, sizeof(*p2->p_md.md_regs));
|
||||
|
||||
p2->p_md.md_regs->tf_eax = 0; /* Child returns zero */
|
||||
p2->p_md.md_regs->tf_eflags &= ~PSL_C; /* success */
|
||||
p2->p_md.md_regs->tf_edx = 1;
|
||||
|
||||
/*
|
||||
* Set registers for trampoline to user mode. Leave space for the
|
||||
* return address on stack. These are the kernel mode register values.
|
||||
|
|
Loading…
Reference in a new issue