#define pr_fmt(fmt) …
#include <linux/hrtimer.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/reboot.h>
#include <linux/types.h>
#include <linux/watchdog.h>
#include <linux/workqueue.h>
#define TIMER_MARGIN …
static unsigned int soft_margin = …;
module_param(soft_margin, uint, 0);
MODULE_PARM_DESC(…) …;
static bool nowayout = … WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(…) …;
static int soft_noboot;
module_param(soft_noboot, int, 0);
MODULE_PARM_DESC(…) …;
static int soft_panic;
module_param(soft_panic, int, 0);
MODULE_PARM_DESC(…) …;
static char *soft_reboot_cmd;
module_param(soft_reboot_cmd, charp, 0000);
MODULE_PARM_DESC(…) …;
static bool soft_active_on_boot;
module_param(soft_active_on_boot, bool, 0000);
MODULE_PARM_DESC(…) …;
static struct hrtimer softdog_ticktock;
static struct hrtimer softdog_preticktock;
static int reboot_kthread_fn(void *data)
{ … }
static void reboot_work_fn(struct work_struct *unused)
{ … }
static enum hrtimer_restart softdog_fire(struct hrtimer *timer)
{ … }
static struct watchdog_device softdog_dev;
static enum hrtimer_restart softdog_pretimeout(struct hrtimer *timer)
{ … }
static int softdog_ping(struct watchdog_device *w)
{ … }
static int softdog_stop(struct watchdog_device *w)
{ … }
static struct watchdog_info softdog_info = …;
static const struct watchdog_ops softdog_ops = …;
static struct watchdog_device softdog_dev = …;
static int __init softdog_init(void)
{ … }
module_init(…) …;
static void __exit softdog_exit(void)
{ … }
module_exit(softdog_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;