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:
John Baldwin 2001-01-24 09:54:44 +00:00
parent 625c76db3a
commit 0d54b9d12c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=71528
2 changed files with 8 additions and 0 deletions

View file

@ -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.

View file

@ -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.