Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Copy PK_32 to p2->p_flag instead of doing it in the cpu_...



details:   https://anonhg.NetBSD.org/src/rev/849c56ae2bd7
branches:  trunk
changeset: 761027:849c56ae2bd7
user:      matt <matt%NetBSD.org@localhost>
date:      Tue Jan 18 23:56:48 2011 +0000

description:
Copy PK_32 to p2->p_flag instead of doing it in the cpu_proc_fork hook.

diffstat:

 sys/arch/sparc64/sparc64/vm_machdep.c |   7 ++-----
 sys/arch/x86/x86/vm_machdep.c         |   6 ++----
 sys/kern/kern_fork.c                  |  10 ++++++----
 3 files changed, 10 insertions(+), 13 deletions(-)

diffs (87 lines):

diff -r 290564f2f6b5 -r 849c56ae2bd7 sys/arch/sparc64/sparc64/vm_machdep.c
--- a/sys/arch/sparc64/sparc64/vm_machdep.c     Tue Jan 18 23:43:21 2011 +0000
+++ b/sys/arch/sparc64/sparc64/vm_machdep.c     Tue Jan 18 23:56:48 2011 +0000
@@ -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
diff -r 290564f2f6b5 -r 849c56ae2bd7 sys/arch/x86/x86/vm_machdep.c
--- a/sys/arch/x86/x86/vm_machdep.c     Tue Jan 18 23:43:21 2011 +0000
+++ b/sys/arch/x86/x86/vm_machdep.c     Tue Jan 18 23:56:48 2011 +0000
@@ -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;
 }
 
 /*
diff -r 290564f2f6b5 -r 849c56ae2bd7 sys/kern/kern_fork.c
--- a/sys/kern/kern_fork.c      Tue Jan 18 23:43:21 2011 +0000
+++ b/sys/kern/kern_fork.c      Tue Jan 18 23:56:48 2011 +0000
@@ -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;
 



Home | Main Index | Thread Index | Old Index