Module Name:    src
Committed By:   jym
Date:           Thu Nov 10 00:12:05 UTC 2011

Modified Files:
        src/sys/arch/amd64/amd64: machdep.c
        src/sys/arch/i386/i386: machdep.c
        src/sys/arch/x86/include: cpu.h

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.711 -r1.712 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/x86/include/cpu.h

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/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.169 src/sys/arch/amd64/amd64/machdep.c:1.170
--- src/sys/arch/amd64/amd64/machdep.c:1.169	Sun Nov  6 15:51:09 2011
+++ src/sys/arch/amd64/amd64/machdep.c	Thu Nov 10 00:12:04 2011
@@ -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 @@ int	physmem;
 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 @@ SYSCTL_SETUP(sysctl_machdep_setup, "sysc
 		       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 @@ init_x86_64(paddr_t first_avail)
 
 	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));

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.711 src/sys/arch/i386/i386/machdep.c:1.712
--- src/sys/arch/i386/i386/machdep.c:1.711	Sun Nov  6 15:35:29 2011
+++ src/sys/arch/i386/i386/machdep.c	Thu Nov 10 00:12:04 2011
@@ -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 @@ struct mtrr_funcs *mtrr_funcs;
 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 @@ SYSCTL_SETUP(sysctl_machdep_setup, "sysc
 		       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 @@ init386(paddr_t first_avail)
 	cpu_init_msrs(&cpu_info_primary, true);
 
 #ifdef PAE
-	i386_use_pae = 1;
+	use_pae = 1;
+#else
+	use_pae = 0;
 #endif
 
 #ifdef XEN

Index: src/sys/arch/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.41 src/sys/arch/x86/include/cpu.h:1.42
--- src/sys/arch/x86/include/cpu.h:1.41	Sun Nov  6 15:18:18 2011
+++ src/sys/arch/x86/include/cpu.h	Thu Nov 10 00:12:05 2011
@@ -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 cpu;
 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;
 

Reply via email to