Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x68k/x68k Fix crashdump on machines with EXTENDED_M...
details: https://anonhg.NetBSD.org/src/rev/6918fa14e2f7
branches: trunk
changeset: 349259:6918fa14e2f7
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Fri Dec 02 12:43:07 2016 +0000
description:
Fix crashdump on machines with EXTENDED_MEMORY.
PR port-x68k/51663 from Rin Okuyama.
diffstat:
sys/arch/x68k/x68k/machdep.c | 29 +++++++++++++++++++----------
1 files changed, 19 insertions(+), 10 deletions(-)
diffs (58 lines):
diff -r 745cde273eed -r 6918fa14e2f7 sys/arch/x68k/x68k/machdep.c
--- a/sys/arch/x68k/x68k/machdep.c Fri Dec 02 12:14:37 2016 +0000
+++ b/sys/arch/x68k/x68k/machdep.c Fri Dec 02 12:43:07 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.193 2016/06/14 07:51:10 isaki Exp $ */
+/* $NetBSD: machdep.c,v 1.194 2016/12/02 12:43:07 tsutsui Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.193 2016/06/14 07:51:10 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.194 2016/12/02 12:43:07 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -553,7 +553,10 @@
{
cpu_kcore_hdr_t *h = &cpu_kcore_hdr;
struct m68k_kcore_hdr *m = &h->un._m68k;
- int i;
+ psize_t size;
+#ifdef EXTENDED_MEMORY
+ int i, seg;
+#endif
memset(&cpu_kcore_hdr, 0, sizeof(cpu_kcore_hdr));
@@ -602,14 +605,20 @@
/*
* X68k has multiple RAM segments on some models.
*/
- m->ram_segs[0].start = lowram;
- m->ram_segs[0].size = mem_size - lowram;
- for (i = 1; i < vm_nphysseg; i++) {
- m->ram_segs[i].start =
- ctob(VM_PHYSMEM_PTR(i)->start);
- m->ram_segs[i].size =
- ctob(VM_PHYSMEM_PTR(i)->end - VM_PHYSMEM_PTR(i)->start);
+ size = phys_basemem_seg.end - phys_basemem_seg.start;
+ m->ram_segs[0].start = phys_basemem_seg.start;
+ m->ram_segs[0].size = size;
+#ifdef EXTENDED_MEMORY
+ seg = 1;
+ for (i = 0; i < EXTMEM_SEGS; i++) {
+ size = phys_extmem_seg[i].end - phys_extmem_seg[i].start;
+ if (size == 0)
+ continue;
+ m->ram_segs[seg].start = phys_extmem_seg[i].start;
+ m->ram_segs[seg].size = size;
+ seg++;
}
+#endif
}
/*
Home |
Main Index |
Thread Index |
Old Index