Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-3]: src/sys/arch Pull up following revision(s) (requested by chs ...
details: https://anonhg.NetBSD.org/src/rev/4b210add8f35
branches: netbsd-3
changeset: 577431:4b210add8f35
user: tron <tron%NetBSD.org@localhost>
date: Tue Nov 01 22:33:25 2005 +0000
description:
Pull up following revision(s) (requested by chs in ticket #923):
sys/arch/next68k/next68k/machdep.c: revision 1.73
sys/arch/luna68k/luna68k/machdep.c: revision 1.42
sys/arch/hp300/hp300/machdep.c: revision 1.184
sys/arch/amiga/amiga/machdep.c: revision 1.193
sys/arch/x68k/x68k/machdep.c: revision 1.129
sys/arch/mac68k/mac68k/machdep.c: revision 1.306
sys/arch/news68k/news68k/machdep.c: revision 1.61
sys/arch/mvme68k/mvme68k/machdep.c: revision 1.113
sys/arch/atari/atari/atari_init.c: revision 1.63
fix crash dumps on m68k platforms, cpu_kcore_hdr_t is larger than
512 bytes now so we need a bigger buffer. PR 26958.
diffstat:
sys/arch/amiga/amiga/machdep.c | 14 +++++++++-----
sys/arch/atari/atari/atari_init.c | 24 ++++++++++++------------
sys/arch/hp300/hp300/machdep.c | 16 +++++++++-------
sys/arch/luna68k/luna68k/machdep.c | 16 +++++++++-------
sys/arch/mac68k/mac68k/machdep.c | 16 +++++++++-------
sys/arch/mvme68k/mvme68k/machdep.c | 16 +++++++++-------
sys/arch/news68k/news68k/machdep.c | 16 +++++++++-------
sys/arch/next68k/next68k/machdep.c | 16 +++++++++-------
sys/arch/x68k/x68k/machdep.c | 16 +++++++++-------
9 files changed, 84 insertions(+), 66 deletions(-)
diffs (truncated from 510 to 300 lines):
diff -r 9bba7c2edfcf -r 4b210add8f35 sys/arch/amiga/amiga/machdep.c
--- a/sys/arch/amiga/amiga/machdep.c Tue Nov 01 22:31:17 2005 +0000
+++ b/sys/arch/amiga/amiga/machdep.c Tue Nov 01 22:33:25 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.190 2004/03/24 15:34:47 atatat Exp $ */
+/* $NetBSD: machdep.c,v 1.190.14.1 2005/11/01 22:33:25 tron Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -85,7 +85,7 @@
#include "opt_panicbutton.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.190 2004/03/24 15:34:47 atatat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.190.14.1 2005/11/01 22:33:25 tron Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -550,6 +550,9 @@
long dumplo = 0;
cpu_kcore_hdr_t cpu_kcore_hdr;
+#define CHDRSIZE (ALIGN(sizeof(kcore_seg_t)) + ALIGN(sizeof(cpu_kcore_hdr_t)))
+#define MDHDRSIZE roundup(CHDRSIZE, dbtob(1))
+
void
cpu_dumpconf()
{
@@ -660,7 +663,7 @@
int error = 0;
kcore_seg_t *kseg_p;
cpu_kcore_hdr_t *chdr_p;
- char dump_hdr[dbtob(1)]; /* XXX assume hdr fits in 1 block */
+ char dump_hdr[MDHDRSIZE];
const struct bdevsw *bdev;
if (dumpdev == NODEV)
@@ -696,7 +699,7 @@
* Generate a segment header
*/
CORE_SETMAGIC(*kseg_p, KCORE_MAGIC, MID_MACHINE, CORE_CPU);
- kseg_p->c_size = dbtob(1) - ALIGN(sizeof(*kseg_p));
+ kseg_p->c_size = MDHDRSIZE - ALIGN(sizeof(*kseg_p));
/*
* Add the md header
@@ -709,7 +712,8 @@
seg = 0;
blkno = dumplo;
dump = bdev->d_dump;
- error = (*dump) (dumpdev, blkno++, (caddr_t)dump_hdr, dbtob(1));
+ error = (*dump) (dumpdev, blkno, (caddr_t)dump_hdr, sizeof(dump_hdr));
+ blkno += btodb(sizeof(dump_hdr));
for (i = 0; i < bytes && error == 0; i += n) {
/* Print out how many MBs we have to go. */
n = bytes - i;
diff -r 9bba7c2edfcf -r 4b210add8f35 sys/arch/atari/atari/atari_init.c
--- a/sys/arch/atari/atari/atari_init.c Tue Nov 01 22:31:17 2005 +0000
+++ b/sys/arch/atari/atari/atari_init.c Tue Nov 01 22:33:25 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atari_init.c,v 1.61 2004/02/13 11:36:11 wiz Exp $ */
+/* $NetBSD: atari_init.c,v 1.61.14.1 2005/11/01 22:33:25 tron Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.61 2004/02/13 11:36:11 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.61.14.1 2005/11/01 22:33:25 tron Exp $");
#include "opt_ddb.h"
#include "opt_mbtype.h"
@@ -797,13 +797,15 @@
* Used by dumpconf() to get the size of the machine-dependent panic-dump
* header in disk blocks.
*/
+
+#define CHDRSIZE (ALIGN(sizeof(kcore_seg_t)) + ALIGN(sizeof(cpu_kcore_hdr_t)))
+#define MDHDRSIZE roundup(CHDRSIZE, dbtob(1))
+
int
cpu_dumpsize()
{
- int size;
- size = ALIGN(sizeof(kcore_seg_t)) + ALIGN(sizeof(cpu_kcore_hdr_t));
- return (btodb(roundup(size, dbtob(1))));
+ return btodb(MDHDRSIZE);
}
/*
@@ -811,11 +813,9 @@
* XXX: Assumes that it will all fit in one diskblock.
*/
int
-cpu_dump(dump, p_blkno)
-int (*dump) __P((dev_t, daddr_t, caddr_t, size_t));
-daddr_t *p_blkno;
+cpu_dump(int (*dump)(dev_t, daddr_t, caddr_t, size_t), daddr_t *p_blkno)
{
- int buf[dbtob(1)/sizeof(int)];
+ int buf[MDHDRSIZE/sizeof(int)];
int error;
kcore_seg_t *kseg_p;
cpu_kcore_hdr_t *chdr_p;
@@ -827,14 +827,14 @@
* Generate a segment header
*/
CORE_SETMAGIC(*kseg_p, KCORE_MAGIC, MID_MACHINE, CORE_CPU);
- kseg_p->c_size = dbtob(1) - ALIGN(sizeof(*kseg_p));
+ kseg_p->c_size = MDHDRSIZE - ALIGN(sizeof(*kseg_p));
/*
* Add the md header
*/
*chdr_p = cpu_kcore_hdr;
- error = dump(dumpdev, *p_blkno, (caddr_t)buf, dbtob(1));
- *p_blkno += 1;
+ error = dump(dumpdev, *p_blkno, (caddr_t)buf, sizeof(buf));
+ *p_blkno += btodb(sizeof(buf));
return (error);
}
diff -r 9bba7c2edfcf -r 4b210add8f35 sys/arch/hp300/hp300/machdep.c
--- a/sys/arch/hp300/hp300/machdep.c Tue Nov 01 22:31:17 2005 +0000
+++ b/sys/arch/hp300/hp300/machdep.c Tue Nov 01 22:33:25 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.182 2005/02/12 08:17:38 yamt Exp $ */
+/* $NetBSD: machdep.c,v 1.182.4.1 2005/11/01 22:33:25 tron Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.182 2005/02/12 08:17:38 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.182.4.1 2005/11/01 22:33:25 tron Exp $");
#include "opt_ddb.h"
#include "opt_compat_hpux.h"
@@ -760,13 +760,15 @@
* Compute the size of the machine-dependent crash dump header.
* Returns size in disk blocks.
*/
+
+#define CHDRSIZE (ALIGN(sizeof(kcore_seg_t)) + ALIGN(sizeof(cpu_kcore_hdr_t)))
+#define MDHDRSIZE roundup(CHDRSIZE, dbtob(1))
+
static int
cpu_dumpsize(void)
{
- int size;
- size = ALIGN(sizeof(kcore_seg_t)) + ALIGN(sizeof(cpu_kcore_hdr_t));
- return (btodb(roundup(size, dbtob(1))));
+ return btodb(MDHDRSIZE);
}
/*
@@ -775,7 +777,7 @@
static int
cpu_dump(int (*dump)(dev_t, daddr_t, caddr_t, size_t), daddr_t *blknop)
{
- int buf[dbtob(1) / sizeof(int)];
+ int buf[MDHDRSIZE / sizeof(int)];
cpu_kcore_hdr_t *chdr;
kcore_seg_t *kseg;
int error;
@@ -786,7 +788,7 @@
/* Create the segment header. */
CORE_SETMAGIC(*kseg, KCORE_MAGIC, MID_MACHINE, CORE_CPU);
- kseg->c_size = dbtob(1) - ALIGN(sizeof(kcore_seg_t));
+ kseg->c_size = MDHDRSIZE - ALIGN(sizeof(kcore_seg_t));
memcpy(chdr, &cpu_kcore_hdr, sizeof(cpu_kcore_hdr_t));
error = (*dump)(dumpdev, *blknop, (caddr_t)buf, sizeof(buf));
diff -r 9bba7c2edfcf -r 4b210add8f35 sys/arch/luna68k/luna68k/machdep.c
--- a/sys/arch/luna68k/luna68k/machdep.c Tue Nov 01 22:31:17 2005 +0000
+++ b/sys/arch/luna68k/luna68k/machdep.c Tue Nov 01 22:33:25 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.39 2005/02/11 15:03:55 yamt Exp $ */
+/* $NetBSD: machdep.c,v 1.39.4.1 2005/11/01 22:33:25 tron Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.39 2005/02/11 15:03:55 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.39.4.1 2005/11/01 22:33:25 tron Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -510,13 +510,15 @@
* Compute the size of the machine-dependent crash dump header.
* Returns size in disk blocks.
*/
+
+#define CHDRSIZE (ALIGN(sizeof(kcore_seg_t)) + ALIGN(sizeof(cpu_kcore_hdr_t)))
+#define MDHDRSIZE roundup(CHDRSIZE, dbtob(1))
+
int
cpu_dumpsize()
{
- int size;
- size = ALIGN(sizeof(kcore_seg_t)) + ALIGN(sizeof(cpu_kcore_hdr_t));
- return (btodb(roundup(size, dbtob(1))));
+ return btodb(MDHDRSIZE);
}
/*
@@ -527,7 +529,7 @@
int (*dump) __P((dev_t, daddr_t, caddr_t, size_t));
daddr_t *blknop;
{
- int buf[dbtob(1) / sizeof(int)];
+ int buf[MDHDRSIZE / sizeof(int)];
cpu_kcore_hdr_t *chdr;
kcore_seg_t *kseg;
int error;
@@ -538,7 +540,7 @@
/* Create the segment header. */
CORE_SETMAGIC(*kseg, KCORE_MAGIC, MID_MACHINE, CORE_CPU);
- kseg->c_size = dbtob(1) - ALIGN(sizeof(kcore_seg_t));
+ kseg->c_size = MDHDRSIZE - ALIGN(sizeof(kcore_seg_t));
bcopy(&cpu_kcore_hdr, chdr, sizeof(cpu_kcore_hdr_t));
error = (*dump)(dumpdev, *blknop, (caddr_t)buf, sizeof(buf));
diff -r 9bba7c2edfcf -r 4b210add8f35 sys/arch/mac68k/mac68k/machdep.c
--- a/sys/arch/mac68k/mac68k/machdep.c Tue Nov 01 22:31:17 2005 +0000
+++ b/sys/arch/mac68k/mac68k/machdep.c Tue Nov 01 22:33:25 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.303 2005/03/05 17:34:06 chs Exp $ */
+/* $NetBSD: machdep.c,v 1.303.2.1 2005/11/01 22:33:25 tron Exp $ */
/*
* Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -107,7 +107,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.303 2005/03/05 17:34:06 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.303.2.1 2005/11/01 22:33:25 tron Exp $");
#include "opt_adb.h"
#include "opt_ddb.h"
@@ -681,13 +681,15 @@
* Compute the size of the machine-dependent crash dump header.
* Returns size in disk blocks.
*/
+
+#define CHDRSIZE (ALIGN(sizeof(kcore_seg_t)) + ALIGN(sizeof(cpu_kcore_hdr_t)))
+#define MDHDRSIZE roundup(CHDRSIZE, dbtob(1))
+
int
cpu_dumpsize(void)
{
- int size;
- size = ALIGN(sizeof(kcore_seg_t)) + ALIGN(sizeof(cpu_kcore_hdr_t));
- return (btodb(roundup(size, dbtob(1))));
+ return btodb(MDHDRSIZE);
}
/*
@@ -696,7 +698,7 @@
int
cpu_dump(int (*dump)(dev_t, daddr_t, caddr_t, size_t), daddr_t *blknop)
{
- int buf[dbtob(1) / sizeof(int)];
+ int buf[MDHDRSIZE / sizeof(int)];
cpu_kcore_hdr_t *chdr;
kcore_seg_t *kseg;
int error;
@@ -707,7 +709,7 @@
/* Create the segment header. */
CORE_SETMAGIC(*kseg, KCORE_MAGIC, MID_MACHINE, CORE_CPU);
- kseg->c_size = dbtob(1) - ALIGN(sizeof(kcore_seg_t));
+ kseg->c_size = MDHDRSIZE - ALIGN(sizeof(kcore_seg_t));
bcopy(&cpu_kcore_hdr, chdr, sizeof(cpu_kcore_hdr_t));
error = (*dump)(dumpdev, *blknop, (caddr_t)buf, sizeof(buf));
diff -r 9bba7c2edfcf -r 4b210add8f35 sys/arch/mvme68k/mvme68k/machdep.c
--- a/sys/arch/mvme68k/mvme68k/machdep.c Tue Nov 01 22:31:17 2005 +0000
+++ b/sys/arch/mvme68k/mvme68k/machdep.c Tue Nov 01 22:33:25 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.111 2005/02/11 15:03:56 yamt Exp $ */
+/* $NetBSD: machdep.c,v 1.111.4.1 2005/11/01 22:33:25 tron Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@@ -77,7 +77,7 @@
Home |
Main Index |
Thread Index |
Old Index