diff options
author | Andrew Cooper <andrew.cooper3@citrix.com> | 2013-08-13 14:29:00 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-08-13 14:29:00 +0200 |
commit | c8177e691f0f611240853326712d43482ec949bf (patch) | |
tree | c2063ee306f0c6a9c0927b2e3b114fe053193878 /xen/include/xen | |
parent | 910daaf5aaa837624099c0fc5c373bea7202ff43 (diff) | |
download | xen-c8177e691f0f611240853326712d43482ec949bf.tar.gz xen-c8177e691f0f611240853326712d43482ec949bf.tar.bz2 xen-c8177e691f0f611240853326712d43482ec949bf.zip |
watchdog: Move watchdog from being x86 specific to common code
Augment watchdog_setup() to be able to possibly return an error, and introduce
watchdog_enabled() as a better alternative to knowing the architectures
internal details.
This patch does not change the x86 implementaion, beyond making it compile.
For header files, some includes of xen/nmi.h were only for the watchdog
functions, so are replaced rather than adding an extra include of
xen/watchdog.h
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/include/xen')
-rw-r--r-- | xen/include/xen/watchdog.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/xen/include/xen/watchdog.h b/xen/include/xen/watchdog.h new file mode 100644 index 0000000000..e786b9b5ab --- /dev/null +++ b/xen/include/xen/watchdog.h @@ -0,0 +1,35 @@ +/****************************************************************************** + * watchdog.h + * + * Common watchdog code + */ + +#ifndef __XEN_WATCHDOG_H__ +#define __XEN_WATCHDOG_H__ + +#include <xen/types.h> + +#ifdef CONFIG_WATCHDOG + +/* Try to set up a watchdog. */ +int watchdog_setup(void); + +/* Enable the watchdog. */ +void watchdog_enable(void); + +/* Disable the watchdog. */ +void watchdog_disable(void); + +/* Is the watchdog currently enabled. */ +bool_t watchdog_enabled(void); + +#else + +#define watchdog_setup() ((void)0) +#define watchdog_enable() ((void)0) +#define watchdog_disable() ((void)0) +#define watchdog_enabled() ((void)0) + +#endif + +#endif /* __XEN_WATCHDOG_H__ */ |