summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1997-08-09 01:44:25 +0000
committerjulian <julian@FreeBSD.org>1997-08-09 01:44:25 +0000
commitc92a006d04dac8d82f56ec61c5d55f89936b41db (patch)
treeabe7af26d48944ae9893cd242f69574ec6d008e4
parent305573cb2990c5d329d149cef5a3b5533b1e8fd9 (diff)
downloadFreeBSD-src-c92a006d04dac8d82f56ec61c5d55f89936b41db.zip
FreeBSD-src-c92a006d04dac8d82f56ec61c5d55f89936b41db.tar.gz
Teach both disk drivers how to cope with a hardware watchdog
while dumping core.. I'm tired of getting 1/2 of a core-dump conditional on -DHW_WDOG for now this will migrate to 2.2 as that's where I need it.
-rw-r--r--sys/i386/isa/wd.c13
-rw-r--r--sys/kern/kern_shutdown.c4
-rw-r--r--sys/scsi/sd.c13
3 files changed, 25 insertions, 5 deletions
diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c
index d2cd257..c5e2e52 100644
--- a/sys/i386/isa/wd.c
+++ b/sys/i386/isa/wd.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
- * $Id: wd.c,v 1.133 1997/07/29 12:57:24 sos Exp $
+ * $Id: wd.c,v 1.134 1997/08/04 05:26:49 dyson Exp $
*/
/* TODO:
@@ -2101,8 +2101,17 @@ out:
CADDR1 + ((int)addr & PAGE_MASK),
DEV_BSIZE / sizeof(short));
addr += DEV_BSIZE;
- if ((unsigned)addr % (1024 * 1024) == 0)
+ /*
+ * If we are dumping core, it may take a while.
+ * So reassure the user and hold off any watchdogs.
+ */
+ if ((unsigned)addr % (1024 * 1024) == 0) {
+#ifdef HW_WDOG
+ if (wdog_tickler)
+ (*wdog_tickler)();
+#endif /* HW_WDOG */
printf("%ld ", num / (1024 * 1024 / DEV_BSIZE));
+ }
num--;
blkcnt--;
}
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index c34e875..5f809a0 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94
- * $Id: kern_shutdown.c,v 1.17 1997/06/22 16:04:16 peter Exp $
+ * $Id: kern_shutdown.c,v 1.18 1997/08/09 01:25:53 julian Exp $
*/
#include "opt_ddb.h"
@@ -90,6 +90,7 @@ SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, CTLFLAG_RW,
#endif
+#ifdef HW_WDOG
/*
* If there is a hardware watchdog, point this at the function needed to
* hold it off.
@@ -98,6 +99,7 @@ SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, CTLFLAG_RW,
* your precious core-dump only half written because the wdog kicked in.
*/
watchdog_tickle_fn wdog_tickler = NULL;
+#endif /* HW_WDOG */
/*
* Variable panicstr contains argument to first call to panic; used as flag
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 8386c42..4578cc7 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -15,7 +15,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992
*
- * $Id: sd.c,v 1.105 1997/05/01 19:15:38 sos Exp $
+ * $Id: sd.c,v 1.106 1997/06/25 19:07:43 tegge Exp $
*/
#include "opt_bounce.h"
@@ -1047,8 +1047,17 @@ sddump(dev_t dev)
return (ENXIO); /* we said not to sleep! */
}
- if ((unsigned) addr % (1024 * 1024) == 0)
+ /*
+ * If we are dumping core, it may take a while.
+ * So reassure the user and hold off any watchdogs.
+ */
+ if ((unsigned)addr % (1024 * 1024) == 0) {
+#ifdef HW_WDOG
+ if (wdog_tickler)
+ (*wdog_tickler)();
+#endif /* HW_WDOG */
printf("%ld ", num / 2048);
+ }
/* update block count */
num -= blkcnt;
blknum += blkcnt;
OpenPOWER on IntegriCloud