Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Define MAXPHYSMEM globally.
details: https://anonhg.NetBSD.org/src/rev/e6d9831a221f
branches: trunk
changeset: 354381:e6d9831a221f
user: maxv <maxv%NetBSD.org@localhost>
date: Wed Jun 14 12:27:24 2017 +0000
description:
Define MAXPHYSMEM globally.
diffstat:
sys/arch/amd64/include/param.h | 7 ++++++-
sys/arch/i386/include/param.h | 11 ++++++++++-
sys/arch/x86/x86/x86_machdep.c | 18 ++++--------------
3 files changed, 20 insertions(+), 16 deletions(-)
diffs (92 lines):
diff -r 514ffe759784 -r e6d9831a221f sys/arch/amd64/include/param.h
--- a/sys/arch/amd64/include/param.h Wed Jun 14 12:24:51 2017 +0000
+++ b/sys/arch/amd64/include/param.h Wed Jun 14 12:27:24 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: param.h,v 1.21 2017/02/02 19:09:08 maxv Exp $ */
+/* $NetBSD: param.h,v 1.22 2017/06/14 12:27:24 maxv Exp $ */
#ifdef __x86_64__
@@ -30,6 +30,11 @@
#define MAXIOMEM 0xffffffffffff
/*
+ * Maximum physical memory supported by the implementation.
+ */
+#define MAXPHYSMEM 0x100000000000ULL /* 16TB */
+
+/*
* XXXfvdl change this (after bootstrap) to take # of bits from
* config info into account.
*/
diff -r 514ffe759784 -r e6d9831a221f sys/arch/i386/include/param.h
--- a/sys/arch/i386/include/param.h Wed Jun 14 12:24:51 2017 +0000
+++ b/sys/arch/i386/include/param.h Wed Jun 14 12:27:24 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: param.h,v 1.80 2017/01/20 00:29:28 maya Exp $ */
+/* $NetBSD: param.h,v 1.81 2017/06/14 12:27:24 maxv Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -67,6 +67,15 @@
#define MAXIOMEM 0xffffffff
+/*
+ * Maximum physical memory supported by the implementation.
+ */
+#ifdef PAE
+#define MAXPHYSMEM 0x1000000000ULL /* 64GB */
+#else
+#define MAXPHYSMEM 0x100000000ULL /* 4GB */
+#endif
+
#if defined(_KERNEL_OPT)
#include "opt_kernbase.h"
#endif /* defined(_KERNEL_OPT) */
diff -r 514ffe759784 -r e6d9831a221f sys/arch/x86/x86/x86_machdep.c
--- a/sys/arch/x86/x86/x86_machdep.c Wed Jun 14 12:24:51 2017 +0000
+++ b/sys/arch/x86/x86/x86_machdep.c Wed Jun 14 12:27:24 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: x86_machdep.c,v 1.92 2017/06/14 08:12:22 maxv Exp $ */
+/* $NetBSD: x86_machdep.c,v 1.93 2017/06/14 12:27:24 maxv Exp $ */
/*-
* Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.92 2017/06/14 08:12:22 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.93 2017/06/14 12:27:24 maxv Exp $");
#include "opt_modular.h"
#include "opt_physmem.h"
@@ -519,17 +519,7 @@
phys_ram_seg_t *cluster;
int i;
-#ifdef i386
-#ifdef PAE
-#define TOPLIMIT 0x1000000000ULL /* 64GB */
-#else
-#define TOPLIMIT 0x100000000ULL /* 4GB */
-#endif
-#else
-#define TOPLIMIT 0x100000000000ULL /* 16TB */
-#endif
-
- if (seg_end > TOPLIMIT) {
+ if (seg_end > MAXPHYSMEM) {
aprint_verbose("WARNING: skipping large memory map entry: "
"0x%"PRIx64"/0x%"PRIx64"/0x%x\n",
seg_start, (seg_end - seg_start), type);
@@ -539,7 +529,7 @@
/*
* XXX: Chop the last page off the size so that it can fit in avail_end.
*/
- if (seg_end == TOPLIMIT)
+ if (seg_end == MAXPHYSMEM)
seg_end -= PAGE_SIZE;
if (seg_end <= seg_start)
Home |
Main Index |
Thread Index |
Old Index