Module Name: src
Committed By: matt
Date: Tue Jan 18 23:56:49 UTC 2011
Modified Files:
src/sys/arch/sparc64/sparc64: vm_machdep.c
src/sys/arch/x86/x86: vm_machdep.c
src/sys/kern: kern_fork.c
Log Message:
Copy PK_32 to p2->p_flag instead of doing it in the cpu_proc_fork hook.
To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/arch/sparc64/sparc64/vm_machdep.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/x86/x86/vm_machdep.c
cvs rdiff -u -r1.178 -r1.179 src/sys/kern/kern_fork.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/sparc64/sparc64/vm_machdep.c
diff -u src/sys/arch/sparc64/sparc64/vm_machdep.c:1.93 src/sys/arch/sparc64/sparc64/vm_machdep.c:1.94
--- src/sys/arch/sparc64/sparc64/vm_machdep.c:1.93 Fri Jan 14 02:06:32 2011
+++ src/sys/arch/sparc64/sparc64/vm_machdep.c Tue Jan 18 23:56:49 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.93 2011/01/14 02:06:32 rmind Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.94 2011/01/18 23:56:49 matt Exp $ */
/*
* Copyright (c) 1996-2002 Eduardo Horvath. All rights reserved.
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.93 2011/01/14 02:06:32 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.94 2011/01/18 23:56:49 matt Exp $");
#include "opt_multiprocessor.h"
@@ -242,9 +242,6 @@
} else
l2->l_md.md_fpstate = NULL;
- if (l1->l_proc->p_flag & PK_32)
- l2->l_proc->p_flag |= PK_32;
-
/*
* Setup (kernel) stack frame that will by-pass the child
* out of the kernel. (The trap frame invariably resides at
Index: src/sys/arch/x86/x86/vm_machdep.c
diff -u src/sys/arch/x86/x86/vm_machdep.c:1.10 src/sys/arch/x86/x86/vm_machdep.c:1.11
--- src/sys/arch/x86/x86/vm_machdep.c:1.10 Wed Jul 7 01:20:50 2010
+++ src/sys/arch/x86/x86/vm_machdep.c Tue Jan 18 23:56:48 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.10 2010/07/07 01:20:50 chs Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.11 2011/01/18 23:56:48 matt Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.10 2010/07/07 01:20:50 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.11 2011/01/18 23:56:48 matt Exp $");
#include "opt_mtrr.h"
@@ -119,8 +119,6 @@
{
p2->p_md.md_flags = p1->p_md.md_flags;
- if (p1->p_flag & PK_32)
- p2->p_flag |= PK_32;
}
/*
Index: src/sys/kern/kern_fork.c
diff -u src/sys/kern/kern_fork.c:1.178 src/sys/kern/kern_fork.c:1.179
--- src/sys/kern/kern_fork.c:1.178 Wed Jul 7 01:30:37 2010
+++ src/sys/kern/kern_fork.c Tue Jan 18 23:56:49 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_fork.c,v 1.178 2010/07/07 01:30:37 chs Exp $ */
+/* $NetBSD: kern_fork.c,v 1.179 2011/01/18 23:56:49 matt Exp $ */
/*-
* Copyright (c) 1999, 2001, 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.178 2010/07/07 01:30:37 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.179 2011/01/18 23:56:49 matt Exp $");
#include "opt_ktrace.h"
@@ -297,9 +297,11 @@
* Increase reference counts on shared objects.
* Inherit flags we want to keep. The flags related to SIGCHLD
* handling are important in order to keep a consistent behaviour
- * for the child after the fork.
+ * for the child after the fork. If we are a 32-bit process, the
+ * child will be too.
*/
- p2->p_flag = p1->p_flag & (PK_SUGID | PK_NOCLDWAIT | PK_CLDSIGIGN);
+ p2->p_flag =
+ p1->p_flag & (PK_SUGID | PK_NOCLDWAIT | PK_CLDSIGIGN | PK_32);
p2->p_emul = p1->p_emul;
p2->p_execsw = p1->p_execsw;