Module Name: src
Committed By: maxv
Date: Wed Jun 14 12:27:24 UTC 2017
Modified Files:
src/sys/arch/amd64/include: param.h
src/sys/arch/i386/include: param.h
src/sys/arch/x86/x86: x86_machdep.c
Log Message:
Define MAXPHYSMEM globally.
To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/amd64/include/param.h
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/i386/include/param.h
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/x86/x86/x86_machdep.c
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/include/param.h
diff -u src/sys/arch/amd64/include/param.h:1.21 src/sys/arch/amd64/include/param.h:1.22
--- src/sys/arch/amd64/include/param.h:1.21 Thu Feb 2 19:09:08 2017
+++ src/sys/arch/amd64/include/param.h Wed Jun 14 12:27:24 2017
@@ -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.
*/
Index: src/sys/arch/i386/include/param.h
diff -u src/sys/arch/i386/include/param.h:1.80 src/sys/arch/i386/include/param.h:1.81
--- src/sys/arch/i386/include/param.h:1.80 Fri Jan 20 00:29:28 2017
+++ src/sys/arch/i386/include/param.h Wed Jun 14 12:27:24 2017
@@ -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) */
Index: src/sys/arch/x86/x86/x86_machdep.c
diff -u src/sys/arch/x86/x86/x86_machdep.c:1.92 src/sys/arch/x86/x86/x86_machdep.c:1.93
--- src/sys/arch/x86/x86/x86_machdep.c:1.92 Wed Jun 14 08:12:22 2017
+++ src/sys/arch/x86/x86/x86_machdep.c Wed Jun 14 12:27:24 2017
@@ -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 @@ x86_add_cluster(uint64_t seg_start, uint
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 @@ x86_add_cluster(uint64_t seg_start, uint
/*
* 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)