CrossCore XA
Revision: 1.0
Programmers Guide
Date: Jul 1, 10
9.
Watchdog Device Interface
The device has a watchdog device, which can be used to reset the device in case if the software does
not respond in predefined time. The watchdog device can be controlled through ioctl() calls.
9.1.
Configuration of device interface
The device node file for the Watchdog device is /dev/watchdog, which is the entry point to the
Watchdog driver.
By default the watchdog is taken care by specific watchdog kicker software called wdt. If user
software wants to take over the watchdog handling, then wdt task should be killed first (for
example killall wdt). If the user software does not want to handle the watchdog anymore, then the
wdt should be restarted. Wdt is started at start-up every time if the watchdog timeout is something
other than zero.
Watchdog timeout is 16 seconds by default. Timeout can be changed from a file
/etc/watchdog_timeout.conf. Value should be between 0 (=disabled) and 16.
9.2.
Summary of data types
The interface to the Watchdog device doesn’t use parameters in ioctl-calls.
9.3.
Interface functions
open
Opens the watchdog device
close
Closes the watchdog device
ioctl
Used for reading and writing from/to device
9.3.1.
open
Description
Opens the watchdog device. The call will return a file descriptor used in subsequent calls such as
read() and ioctl().
Include files
#include <fctnl.h>
Syntax
int open(
const char *pathname,
int flags
)
Parameters
pathname
Path to the device file
flags
Parameter flag must include one of the following access modes: O_RDONLY,
O_WRONLY or O_RDWR
www.crosscontrol.com
46