Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Turn the 'i386_use_pae' variable into simply 'use_p...



details:   https://anonhg.NetBSD.org/src/rev/6d1e38d36f37
branches:  trunk
changeset: 771116:6d1e38d36f37
user:      jym <jym%NetBSD.org@localhost>
date:      Thu Nov 10 00:12:04 2011 +0000

description:
Turn the 'i386_use_pae' variable into simply 'use_pae'. Technically
speaking we are also running with PAE enabled in long mode under amd64,
so this variable will be used in various places across x86 machdep to
branch at runtime to functions that require extra handling for PAE mode.

diffstat:

 sys/arch/amd64/amd64/machdep.c |  12 +++++++-----
 sys/arch/i386/i386/machdep.c   |  12 +++++++-----
 sys/arch/x86/include/cpu.h     |   4 ++--
 3 files changed, 16 insertions(+), 12 deletions(-)

diffs (121 lines):

diff -r 32c07847f9eb -r 6d1e38d36f37 sys/arch/amd64/amd64/machdep.c
--- a/sys/arch/amd64/amd64/machdep.c    Wed Nov 09 20:26:41 2011 +0000
+++ b/sys/arch/amd64/amd64/machdep.c    Thu Nov 10 00:12:04 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.169 2011/11/06 15:51:09 cherry Exp $     */
+/*     $NetBSD: machdep.c,v 1.170 2011/11/10 00:12:04 jym Exp $        */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -111,7 +111,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.169 2011/11/06 15:51:09 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.170 2011/11/10 00:12:04 jym Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -242,7 +242,7 @@
 uint64_t       dumpmem_low;
 uint64_t       dumpmem_high;
 int    cpu_class;
-
+int    use_pae;
 
 #ifndef NO_SPARSE_DUMP
 int sparse_dump = 0;
@@ -568,10 +568,10 @@
                       NULL, 0, &tsc_freq, 0,
                       CTL_MACHDEP, CTL_CREATE, CTL_EOL);
        sysctl_createv(clog, 0, NULL, NULL,
-                      CTLFLAG_PERMANENT | CTLFLAG_IMMEDIATE,
+                      CTLFLAG_PERMANENT,
                       CTLTYPE_INT, "pae",
                       SYSCTL_DESCR("Whether the kernel uses PAE"),
-                      NULL, 1, NULL, 0,
+                      NULL, 0, &use_pae, 0,
                       CTL_MACHDEP, CTL_CREATE, CTL_EOL);
 #ifndef NO_SPARSE_DUMP
        /* XXXjld Does this really belong under machdep, and not e.g. kern? */
@@ -1646,6 +1646,8 @@
 
        pcb = lwp_getpcb(&lwp0);
 
+       use_pae = 1; /* PAE always enabled in long mode */
+
 #ifdef XEN
        pcb->pcb_cr3 = xen_start_info.pt_base - KERNBASE;
        __PRINTK(("pcb_cr3 0x%lx\n", xen_start_info.pt_base - KERNBASE));
diff -r 32c07847f9eb -r 6d1e38d36f37 sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c      Wed Nov 09 20:26:41 2011 +0000
+++ b/sys/arch/i386/i386/machdep.c      Thu Nov 10 00:12:04 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.711 2011/11/06 15:35:29 cherry Exp $     */
+/*     $NetBSD: machdep.c,v 1.712 2011/11/10 00:12:04 jym Exp $        */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.711 2011/11/06 15:35:29 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.712 2011/11/10 00:12:04 jym Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -246,12 +246,12 @@
 int    physmem;
 
 int    cpu_class;
+int    use_pae;
 int    i386_fpu_present;
 int    i386_fpu_exception;
 int    i386_fpu_fdivbug;
 
 int    i386_use_fxsave;
-int    i386_use_pae = 0;
 int    i386_has_sse;
 int    i386_has_sse2;
 
@@ -713,7 +713,7 @@
                       CTLFLAG_PERMANENT,
                       CTLTYPE_INT, "pae", 
                       SYSCTL_DESCR("Whether the kernel uses PAE"),
-                      NULL, 0, &i386_use_pae, 0,
+                      NULL, 0, &use_pae, 0,
                       CTL_MACHDEP, CTL_CREATE, CTL_EOL);
 }
 
@@ -1348,7 +1348,9 @@
        cpu_init_msrs(&cpu_info_primary, true);
 
 #ifdef PAE
-       i386_use_pae = 1;
+       use_pae = 1;
+#else
+       use_pae = 0;
 #endif
 
 #ifdef XEN
diff -r 32c07847f9eb -r 6d1e38d36f37 sys/arch/x86/include/cpu.h
--- a/sys/arch/x86/include/cpu.h        Wed Nov 09 20:26:41 2011 +0000
+++ b/sys/arch/x86/include/cpu.h        Thu Nov 10 00:12:04 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.41 2011/11/06 15:18:18 cherry Exp $  */
+/*     $NetBSD: cpu.h,v 1.42 2011/11/10 00:12:05 jym Exp $     */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -362,9 +362,9 @@
 extern int cpuid_level;
 extern int cpu_class;
 extern char cpu_brand_string[];
+extern int use_pae;
 
 extern int i386_use_fxsave;
-extern int i386_use_pae;
 extern int i386_has_sse;
 extern int i386_has_sse2;
 



Home | Main Index | Thread Index | Old Index