atomic_dec(&watchdog_disable_count);
}
-void __init watchdog_setup(void)
+bool_t watchdog_enabled(void)
+{
+ return !atomic_read(&watchdog_disable_count);
+}
+
+int __init watchdog_setup(void)
{
unsigned int cpu;
register_cpu_notifier(&cpu_nmi_nfb);
watchdog_enable();
+ return 0;
}
void nmi_watchdog_tick(struct cpu_user_regs * regs)
#include <xen/pfn.h>
#include <xen/nodemask.h>
#include <xen/tmem_xen.h> /* for opt_tmem only */
+#include <xen/watchdog.h>
#include <public/version.h>
#include <compat/platform.h>
#include <compat/xen.h>
#include <xen/delay.h>
#include <xen/dmi.h>
#include <xen/irq.h>
-#include <xen/nmi.h>
+#include <xen/watchdog.h>
#include <xen/console.h>
#include <xen/shutdown.h>
#include <xen/acpi.h>
#include <xen/kexec.h>
#include <xen/trace.h>
#include <xen/paging.h>
+#include <xen/watchdog.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/atomic.h>
#include <xen/shutdown.h>
#include <xen/nmi.h>
#include <xen/guest_access.h>
+#include <xen/watchdog.h>
#include <asm/current.h>
#include <asm/flushtlb.h>
#include <asm/traps.h>
#include <xen/ctype.h>
#include <xen/errno.h>
#include <xen/guest_access.h>
-#include <xen/nmi.h>
+#include <xen/watchdog.h>
#include <xen/sched.h>
#include <xen/types.h>
#include <xen/hypercall.h>
#include <xen/ctype.h>
#include <xen/perfc.h>
#include <xen/mm.h>
-#include <xen/nmi.h>
+#include <xen/watchdog.h>
#include <xen/init.h>
#include <asm/debugger.h>
#include <asm/div64.h>
#include <xen/sched.h>
#include <xen/domain.h>
#include <xen/delay.h>
-#include <xen/nmi.h>
+#include <xen/watchdog.h>
#include <xen/shutdown.h>
#include <xen/console.h>
#ifdef CONFIG_KEXEC
#include <xen/keyhandler.h>
#include <xen/delay.h>
#include <xen/guest_access.h>
-#include <xen/nmi.h>
+#include <xen/watchdog.h>
#include <xen/shutdown.h>
#include <xen/video.h>
#include <xen/kexec.h>
#define CONFIG_XENOPROF 1
#define CONFIG_KEXEC 1
+#define CONFIG_WATCHDOG 1
#define HZ 100
*/
long unregister_guest_nmi_callback(void);
-void watchdog_disable(void);
-void watchdog_enable(void);
-void watchdog_setup(void);
-
#endif /* ASM_NMI_H */
--- /dev/null
+/******************************************************************************
+ * 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__ */