Subject: port-i386/9240: Lying comment in i386 vm_machdep.c
To: None <gnats-bugs@gnats.netbsd.org>
From: None <dholland@hcs.harvard.edu>
List: netbsd-bugs
Date: 01/19/2000 04:36:51
>Number: 9240
>Category: port-i386
>Synopsis: Fix for obsolete comment in i386 vm_machdep.c
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: port-i386-maintainer (NetBSD/i386 Portmaster)
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Wed Jan 19 04:36:00 2000
>Last-Modified:
>Originator: David A. Holland
>Organization:
VINO project: http://www.eecs.harvard.edu/vino
>Release: -current of 2000-Jan-19
>Environment:
System: NetBSD merlin 1.4P NetBSD 1.4P (MERLIN) #8: Sun Jan 16 06:29:00 EST 2000 src@merlin:/usr/src/sys/arch/i386/compile/MERLIN i386
Today's -current.
>Description:
The comment at the top of cpu_fork is out of date and reflects
an earlier version of the code.
>How-To-Repeat:
n/a
>Fix:
Index: vm_machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/i386/i386/vm_machdep.c,v
retrieving revision 1.85
diff -u -r1.85 vm_machdep.c
--- vm_machdep.c 1999/12/04 21:20:33 1.85
+++ vm_machdep.c 2000/01/19 12:11:17
@@ -77,12 +77,16 @@
/*
* Finish a fork operation, with process p2 nearly set up.
- * Copy and update the kernel stack and pcb, making the child
- * ready to run, and marking it so that it can return differently
- * than the parent. Returns 1 in the child process, 0 in the parent.
- * We currently double-map the user area so that the stack is at the same
- * address in each process; in the future we will probably relocate
- * the frame pointers on the stack after copying.
+ * Copy and update the pcb, making the child ready to run.
+ *
+ * Rig the child's kernel stack so that it will start out in
+ * proc_trampoline() and call child_return() with p2 as an
+ * argument. This causes the child process to go directly to
+ * user level with an apparent return value of 0 from fork().
+ *
+ * If an alternate user-level stack is requested
+ * (stack and stacksize args), set up the user %esp
+ * accordingly.
*/
void
cpu_fork(p1, p2, stack, stacksize)
>Audit-Trail:
>Unformatted: