Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Add machdep.pae sysctl(7) for i386. Thanks to Paul ...
details: https://anonhg.NetBSD.org/src/rev/7dd4dbe4b6e9
branches: trunk
changeset: 757156:7dd4dbe4b6e9
user: jym <jym%NetBSD.org@localhost>
date: Mon Aug 16 19:39:06 2010 +0000
description:
Add machdep.pae sysctl(7) for i386. Thanks to Paul and Joerg for their
reviews.
In kernel, it matches the 'i386_use_pae' variable (0: kernel does not use
PAE, 1: kernel uses PAE). Will be used by i386 kvm(3) to know the functions
that should get called for VA => PA translations.
diffstat:
sys/arch/i386/i386/machdep.c | 14 ++++++++++++--
sys/arch/x86/include/cpu.h | 3 ++-
2 files changed, 14 insertions(+), 3 deletions(-)
diffs (66 lines):
diff -r 5781c53cd622 -r 7dd4dbe4b6e9 sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c Mon Aug 16 18:32:44 2010 +0000
+++ b/sys/arch/i386/i386/machdep.c Mon Aug 16 19:39:06 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.692 2010/08/07 20:07:26 jruoho Exp $ */
+/* $NetBSD: machdep.c,v 1.693 2010/08/16 19:39:06 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.692 2010/08/07 20:07:26 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.693 2010/08/16 19:39:06 jym Exp $");
#include "opt_beep.h"
#include "opt_compat_ibcs2.h"
@@ -250,6 +250,7 @@
int i386_fpu_fdivbug;
int i386_use_fxsave;
+int i386_use_pae = 0;
int i386_has_sse;
int i386_has_sse2;
@@ -690,6 +691,11 @@
CTLTYPE_QUAD, "tsc_freq", NULL,
NULL, 0, &tsc_freq, 0,
CTL_MACHDEP, CTL_CREATE, CTL_EOL);
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_INT, "pae", "Whether the kernel uses PAE",
+ NULL, 0, &i386_use_pae, 0,
+ CTL_MACHDEP, CTL_CREATE, CTL_EOL);
}
void *
@@ -1302,6 +1308,10 @@
cpu_init_msrs(&cpu_info_primary, true);
+#ifdef PAE
+ i386_use_pae = 1;
+#endif
+
#ifdef XEN
pcb->pcb_cr3 = PDPpaddr;
__PRINTK(("pcb_cr3 0x%lx cr3 0x%lx\n",
diff -r 5781c53cd622 -r 7dd4dbe4b6e9 sys/arch/x86/include/cpu.h
--- a/sys/arch/x86/include/cpu.h Mon Aug 16 18:32:44 2010 +0000
+++ b/sys/arch/x86/include/cpu.h Mon Aug 16 19:39:06 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.24 2010/08/04 10:02:11 jruoho Exp $ */
+/* $NetBSD: cpu.h,v 1.25 2010/08/16 19:39:06 jym Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -341,6 +341,7 @@
extern char cpu_brand_string[];
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