Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/aarch64/aarch64 redo the previous using ptoa(). al...



details:   https://anonhg.NetBSD.org/src/rev/62c2c0418ddf
branches:  trunk
changeset: 447006:62c2c0418ddf
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Dec 27 21:48:01 2018 +0000

description:
redo the previous using ptoa().  also apply to another instance of
the same integer overflow, and now savecore actually does something
in the OD1K.

diffstat:

 sys/arch/aarch64/aarch64/aarch64_machdep.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 3ba99ed051c3 -r 62c2c0418ddf sys/arch/aarch64/aarch64/aarch64_machdep.c
--- a/sys/arch/aarch64/aarch64/aarch64_machdep.c        Thu Dec 27 21:35:48 2018 +0000
+++ b/sys/arch/aarch64/aarch64/aarch64_machdep.c        Thu Dec 27 21:48:01 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.25 2018/12/27 21:29:41 mrg Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.26 2018/12/27 21:48:01 mrg Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.25 2018/12/27 21:29:41 mrg Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.26 2018/12/27 21:48:01 mrg Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -573,7 +573,7 @@
         */
        for (i = 0; i < bootconfig.dramblocks; i++) {
                memsegp[i].start = bootconfig.dram[i].address;
-               memsegp[i].size = bootconfig.dram[i].pages * PAGE_SIZE;
+               memsegp[i].size = ptoa(bootconfig.dram[i].pages);
        }
 
        return (dump(dumpdev, dumplo, bf, dbtob(1)));
@@ -629,7 +629,7 @@
        for (block = 0; block < bootconfig.dramblocks && error == 0; ++block) {
                addr = bootconfig.dram[block].address;
                end = bootconfig.dram[block].address +
-                     ((uint64_t)bootconfig.dram[block].pages * PAGE_SIZE);
+                     ptoa(bootconfig.dram[block].pages);
                for (; addr < end; addr += PAGE_SIZE) {
                        if (((len * PAGE_SIZE) % (1024*1024)) == 0)
                                printf("%lu ", (len * PAGE_SIZE) / (1024 * 1024));



Home | Main Index | Thread Index | Old Index