WDOG_REGISTER(9) | Kernel Developer's Manual | WDOG_REGISTER(9)

# NAME

`wdog_register` — kernel watchdog interface

# SYNOPSIS

`#include <sys/systm.h>`

void
`wdog_register`(int (*cb)(void *cb_arg, int period), void *cb_arg);

# DESCRIPTION

The kernel watchdog interface is used by hardware watchdog drivers and should be used for all future drivers.

`wdog_register`() is called by the hardware driver after configuring the hardware watchdog device. The cb_arg argument is a pointer to the hardware device control structure. The cb argument is a pointer to a function supplied by the driver which sets the timeout in the hardware device.

The cb_arg parameter given to cb is a pointer to the device control structure. The period parameter supplies the desired timeout value in seconds. A period value of zero disables the watchdog. Setting the timeout to a nonzero value after disabling the watchdog will update the timeout value and enable the watchdog.

# CODE REFERENCES

The framework is implemented in the file sys/kern/kern_watchdog.c.

# SEE ALSO

watchdog(4), sysctl_int(9), timeout(9)

# HISTORY

The watchdog timer framework was written by Markus Friedl <markus@openbsd.org> and first appeared in OpenBSD 3.3.

July 17, 2013 | Debian