Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbarm/fdt Style around setting the physical memory...



details:   https://anonhg.NetBSD.org/src/rev/05f641c5ecd7
branches:  trunk
changeset: 946413:05f641c5ecd7
user:      skrll <skrll%NetBSD.org@localhost>
date:      Thu Nov 26 08:37:54 2020 +0000

description:
Style around setting the physical memory limit.  NFCI.

diffstat:

 sys/arch/evbarm/fdt/fdt_machdep.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (33 lines):

diff -r bda9c18da9f1 -r 05f641c5ecd7 sys/arch/evbarm/fdt/fdt_machdep.c
--- a/sys/arch/evbarm/fdt/fdt_machdep.c Thu Nov 26 08:29:17 2020 +0000
+++ b/sys/arch/evbarm/fdt/fdt_machdep.c Thu Nov 26 08:37:54 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.80 2020/11/26 08:29:17 skrll Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.81 2020/11/26 08:37:54 skrll Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.80 2020/11/26 08:29:17 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.81 2020/11/26 08:37:54 skrll Exp $");
 
 #include "opt_machdep.h"
 #include "opt_bootconfig.h"
@@ -623,10 +623,10 @@
        fdt_get_memory(&memory_start, &memory_end);
 
 #if !defined(_LP64)
-       /* Cannot map memory above 4GB */
-       if (memory_end >= 0x100000000ULL)
-               memory_end = 0x100000000ULL - PAGE_SIZE;
-
+       /* Cannot map memory above 4GB (remove last page as well) */
+       const uint64_t memory_limit = 0x100000000ULL - PAGE_SIZE;
+       if (memory_end > memory_limit)
+               memory_end = memory_limit;
 #endif
        uint64_t memory_size = memory_end - memory_start;
 



Home | Main Index | Thread Index | Old Index