summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_shutdown.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1997-08-09 01:25:54 +0000
committerjulian <julian@FreeBSD.org>1997-08-09 01:25:54 +0000
commit9b3d3ce7fac3f89596fec9ee8623b3f5774fbb3c (patch)
tree7059232c0a1d9ad618c0c06f4124d6fd71c25127 /sys/kern/kern_shutdown.c
parent0ab350a9e57d3fd52bd599e6b290fdcb53b74e11 (diff)
downloadFreeBSD-src-9b3d3ce7fac3f89596fec9ee8623b3f5774fbb3c.zip
FreeBSD-src-9b3d3ce7fac3f89596fec9ee8623b3f5774fbb3c.tar.gz
Use up 4 precious bytes to give the kernel a hook to
support hardware watchdogs. The actual functions would be supplied in an LKM or a linked file, but they need to hang off something.
Diffstat (limited to 'sys/kern/kern_shutdown.c')
-rw-r--r--sys/kern/kern_shutdown.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index 1353dbf..c34e875 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.16 1997/06/15 02:03:03 wollman Exp $
+ * $Id: kern_shutdown.c,v 1.17 1997/06/22 16:04:16 peter Exp $
*/
#include "opt_ddb.h"
@@ -91,6 +91,15 @@ SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, CTLFLAG_RW,
/*
+ * If there is a hardware watchdog, point this at the function needed to
+ * hold it off.
+ * It's needed when the kernel needs to do some lengthy operations.
+ * e.g. in wd.c when dumping core.. It's most annoying to have
+ * your precious core-dump only half written because the wdog kicked in.
+ */
+watchdog_tickle_fn wdog_tickler = NULL;
+
+/*
* Variable panicstr contains argument to first call to panic; used as flag
* to indicate that the kernel has already called panic.
*/
@@ -190,12 +199,19 @@ boot(howto)
}
}
#endif
+ /*
+ * Do any callouts that should be done BEFORE syncing the filesystems.
+ */
ep = shutdown_list1;
while (ep) {
shutdown_list1 = ep->next;
(*ep->function)(howto, ep->arg);
ep = ep->next;
}
+
+ /*
+ * Now sync filesystems
+ */
if (!cold && (howto & RB_NOSYNC) == 0 && waittime < 0) {
register struct buf *bp;
int iter, nbusy;
@@ -243,6 +259,11 @@ boot(howto)
}
DELAY(100000); /* wait for console output to finish */
}
+
+ /*
+ * Ok, now do things that assume all filesystem activity has
+ * been completed.
+ */
ep = shutdown_list2;
while (ep) {
shutdown_list2 = ep->next;
OpenPOWER on IntegriCloud