summaryrefslogtreecommitdiffstats
path: root/sys/sys/watchdog.h
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2013-02-27 19:03:31 +0000
committeralfred <alfred@FreeBSD.org>2013-02-27 19:03:31 +0000
commit743bccf1ecd630e8a4bc5f9e27f286fc4567e98d (patch)
treec811638778fdb39d8898681e0f6391ecf9ba3e04 /sys/sys/watchdog.h
parent8d28f9479090da520ef392412da9129ec48f85ea (diff)
downloadFreeBSD-src-743bccf1ecd630e8a4bc5f9e27f286fc4567e98d.zip
FreeBSD-src-743bccf1ecd630e8a4bc5f9e27f286fc4567e98d.tar.gz
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
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 ba58a7c..92c47de 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
OpenPOWER on IntegriCloud