summaryrefslogtreecommitdiffstats
path: root/sys/ddb/db_command.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-02-29 09:55:32 +0000
committerphk <phk@FreeBSD.org>2004-02-29 09:55:32 +0000
commit0feacd16e38cc6baefbc51bcc5ec34deaf4f3b21 (patch)
treeaba889f438fee983546e64139564ee6d8fe8a733 /sys/ddb/db_command.c
parent4b97c7dd5ad65c72c16f3c627c7999fd6971d936 (diff)
downloadFreeBSD-src-0feacd16e38cc6baefbc51bcc5ec34deaf4f3b21.zip
FreeBSD-src-0feacd16e38cc6baefbc51bcc5ec34deaf4f3b21.tar.gz
Give DDB a "watchdog" command which disables all watchdogs.
Diffstat (limited to 'sys/ddb/db_command.c')
-rw-r--r--sys/ddb/db_command.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
index 9f41582..70b3556 100644
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
#include <sys/signalvar.h>
#include <sys/systm.h>
#include <sys/cons.h>
+#include <sys/watchdog.h>
#include <ddb/ddb.h>
#include <ddb/db_command.h>
@@ -69,6 +70,7 @@ static db_cmdfcn_t db_fncall;
static db_cmdfcn_t db_gdb;
static db_cmdfcn_t db_kill;
static db_cmdfcn_t db_reset;
+static db_cmdfcn_t db_watchdog;
/* XXX this is actually forward-static. */
extern struct command db_show_cmds[];
@@ -422,6 +424,7 @@ static struct command db_command_table[] = {
{ "gdb", db_gdb, 0, 0 },
{ "reset", db_reset, 0, 0 },
{ "kill", db_kill, CS_OWN, 0 },
+ { "watchdog", db_watchdog, 0, 0 },
{ (char *)0, }
};
@@ -639,3 +642,21 @@ db_reset(dummy1, dummy2, dummy3, dummy4)
cpu_reset();
}
+
+static void
+db_watchdog(dummy1, dummy2, dummy3, dummy4)
+ db_expr_t dummy1;
+ boolean_t dummy2;
+ db_expr_t dummy3;
+ char * dummy4;
+{
+ int i;
+
+ /*
+ * XXX: It might make sense to be able to set the watchdog to a
+ * XXX: timeout here so that failure or hang as a result of subsequent
+ * XXX: ddb commands could be recovered by a reset.
+ */
+
+ EVENTHANDLER_INVOKE(watchdog_list, 0, &i);
+}
OpenPOWER on IntegriCloud