aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/watchdog.h
diff options
context:
space:
mode:
authorAttilio Rao <attilio@FreeBSD.org>2011-04-27 16:43:03 +0000
committerAttilio Rao <attilio@FreeBSD.org>2011-04-27 16:43:03 +0000
commit7126ba42f6aed181e974246d46bfe3409da8b8ac (patch)
treed3424aa0d35dd3d768f6340460e2af4a0b15b244 /sys/sys/watchdog.h
parent0e24a634ce94c61d720960d8122d2cb581ba6153 (diff)
downloadsrc-7126ba42f6aed181e974246d46bfe3409da8b8ac.tar.gz
src-7126ba42f6aed181e974246d46bfe3409da8b8ac.zip
- Add the possibility to reuse the already last used timeout when patting
the watchdog, via the watchdog(9) interface. For that, the WD_LASTVAL bitwise operation is used. It is mutually exclusive with any explicit timout passing to the watchdogs. The last timeout can be returned via the wdog_kern_last_timeout() KPI. - Add the possibility to pat the watchdogs installed via the watchdog(9) interface from the kernel. In order to do that the new KPI wdog_kern_pat() is offered and it does accept normalized nanoseconds or WD_LASTVAL. - Avoid to pass WD_ACTIVE down in the watchdog handlers. All the control bit processing should over to the upper layer functions and not passed down to the handlers at all. These changes are intended to be used in order to fix up the watchdog tripping in situation when the userland is busted, but protection is still wanted (examples: shutdown syncing / disk dumping). Sponsored by: Sandvine Incorporated Reviewed by: emaste, des, cognet MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=221121
Diffstat (limited to 'sys/sys/watchdog.h')
-rw-r--r--sys/sys/watchdog.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/sys/watchdog.h b/sys/sys/watchdog.h
index 941077593384..ba58a7c69a5d 100644
--- a/sys/sys/watchdog.h
+++ b/sys/sys/watchdog.h
@@ -50,6 +50,12 @@
* right to the kernel.
*/
+#define WD_LASTVAL 0x0200000
+ /*
+ * Use the already last used timeout value.
+ * The kernel will use as timeout the last valid timeout provided.
+ */
+
#define WD_INTERVAL 0x00000ff
/*
* Mask for duration bits.
@@ -78,6 +84,9 @@
typedef void (*watchdog_fn)(void *, u_int, int *);
EVENTHANDLER_DECLARE(watchdog_list, watchdog_fn);
+
+u_int wdog_kern_last_timeout(void);
+int wdog_kern_pat(u_int utim);
#endif
#endif /* _SYS_WATCHDOG_H */