Give DDB a "watchdog" command which disables all watchdogs.

This commit is contained in:
Poul-Henning Kamp 2004-02-29 09:55:32 +00:00
parent d6bfbcc360
commit 74cc032b41
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126399

View file

@ -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);
}