aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/watchdog.h
diff options
context:
space:
mode:
authorAlfred Perlstein <alfred@FreeBSD.org>2013-02-27 19:03:31 +0000
committerAlfred Perlstein <alfred@FreeBSD.org>2013-02-27 19:03:31 +0000
commit4b9b732ac0023efb10c6f3f61d804cfe1fb785e6 (patch)
treec811638778fdb39d8898681e0f6391ecf9ba3e04 /sys/sys/watchdog.h
parentdc1558d1cd79a8244a37aaee3d50c97b0657b5ff (diff)
downloadsrc-4b9b732ac0023efb10c6f3f61d804cfe1fb785e6.tar.gz
src-4b9b732ac0023efb10c6f3f61d804cfe1fb785e6.zip
watchdogd(8) and watchdog(4) enhancements.
The following support was added to watchdog(4): - Support to query the outstanding timeout. - Support to set a software pre-timeout function watchdog with an 'action' - Support to set a software only watchdog with a configurable 'action' 'action' can be a mask specifying a single operation or a combination of: log(9), printf(9), panic(9) and/or kdb_enter(9). Support the following in watchdogged: - Support to utilize the new additions to watchdog(4). - Support to warn if a watchdog script runs for too long. - Support for "dry run" where we do not actually arm the watchdog, but only report on our timing. Sponsored by: iXsystems, Inc. MFC after: 1 month
Notes
Notes: svn path=/head/; revision=247405
Diffstat (limited to 'sys/sys/watchdog.h')
-rw-r--r--sys/sys/watchdog.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/sys/sys/watchdog.h b/sys/sys/watchdog.h
index ba58a7c69a5d..92c47dee75f6 100644
--- a/sys/sys/watchdog.h
+++ b/sys/sys/watchdog.h
@@ -1,5 +1,8 @@
/*-
* Copyright (c) 2003 Poul-Henning Kamp
+ * Copyright (c) 2013 iXsystems.com,
+ * author: Alfred Perlstein <alfred@freebsd.org>
+ *
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,7 +35,18 @@
#define _PATH_WATCHDOG "fido"
-#define WDIOCPATPAT _IOW('W', 42, u_int)
+#define WDIOCPATPAT _IOW('W', 42, u_int) /* pat the watchdog */
+#define WDIOC_SETTIMEOUT _IOW('W', 43, int) /* set/reset the timer */
+#define WDIOC_GETTIMEOUT _IOR('W', 44, int) /* get total timeout */
+#define WDIOC_GETTIMELEFT _IOR('W', 45, int) /* get time left */
+#define WDIOC_GETPRETIMEOUT _IOR('W', 46, int) /* get the pre-timeout */
+#define WDIOC_SETPRETIMEOUT _IOW('W', 47, int) /* set the pre-timeout */
+/* set the action when a pre-timeout occurs see: WD_SOFT_* */
+#define WDIOC_SETPRETIMEOUTACT _IOW('W', 48, int)
+
+/* use software watchdog instead of hardware */
+#define WDIOC_SETSOFT _IOW('W', 49, int)
+#define WDIOC_SETSOFTTIMEOUTACT _IOW('W', 50, int)
#define WD_ACTIVE 0x8000000
/*
@@ -76,6 +90,15 @@
#define WD_TO_8SEC 33
#define WD_TO_16SEC 34
#define WD_TO_32SEC 35
+#define WD_TO_64SEC 36
+#define WD_TO_128SEC 37
+
+/* action on pre-timeout trigger */
+#define WD_SOFT_PANIC 0x01 /* panic */
+#define WD_SOFT_DDB 0x02 /* enter debugger */
+#define WD_SOFT_LOG 0x04 /* log(9) */
+#define WD_SOFT_PRINTF 0x08 /* printf(9) */
+#define WD_SOFT_MASK 0x0f /* all of the above */
#ifdef _KERNEL