2004-02-28 20:08:41 +00:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2004 Poul-Henning Kamp <phk@FreeBSD.org
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
|
|
|
.Dd February 28, 2004
|
2004-07-06 07:39:50 +00:00
|
|
|
.Dt WATCHDOG 9
|
2004-02-28 20:08:41 +00:00
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm watchdog
|
2004-07-06 07:39:50 +00:00
|
|
|
.Nd "software and hardware watchdog facility"
|
2004-02-28 20:08:41 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.In sys/watchdog.h
|
2004-07-06 07:39:50 +00:00
|
|
|
.Ft void
|
2004-02-28 20:08:41 +00:00
|
|
|
.Fn watchdog_fn "void *private" "u_int cmd" "int *error"
|
2004-07-06 07:39:50 +00:00
|
|
|
.Fn EVENTHANDLER_REGISTER watchdog_list watchdog_fn private 0
|
2004-02-28 20:08:41 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
To implement a watchdog in software or hardware, only a single
|
|
|
|
function needs to be written and registered on the global
|
2004-07-06 07:39:50 +00:00
|
|
|
.Va watchdog_list .
|
2004-02-28 20:08:41 +00:00
|
|
|
.Pp
|
2004-07-06 07:39:50 +00:00
|
|
|
The function must examine the
|
|
|
|
.Fa cmd
|
|
|
|
argument and act on it as
|
2004-02-28 20:08:41 +00:00
|
|
|
follows:
|
|
|
|
.Pp
|
2004-07-06 07:39:50 +00:00
|
|
|
If
|
|
|
|
.Fa cmd
|
|
|
|
is zero, the watchdog must be disabled and the
|
|
|
|
.Fa error
|
2004-02-28 20:08:41 +00:00
|
|
|
argument left untouched.
|
|
|
|
.Pp
|
|
|
|
Else the watchdog should be reset and configured to a timeout of
|
2004-07-06 07:39:50 +00:00
|
|
|
.Pq 1 << Pq Fa cmd No & Dv WD_INTERVAL
|
|
|
|
nanoseconds or larger and the
|
|
|
|
.Fa error
|
|
|
|
argument be set to zero.
|
2004-02-28 20:08:41 +00:00
|
|
|
.Pp
|
2004-07-06 07:39:50 +00:00
|
|
|
If the watchdog cannot be configured to the proposed timeout, it
|
|
|
|
must be disabled and the
|
|
|
|
.Fa error
|
|
|
|
argument left untouched.
|
2004-02-28 20:08:41 +00:00
|
|
|
.Pp
|
|
|
|
There is no specification of what the watchdog should do when it
|
2004-07-06 07:39:50 +00:00
|
|
|
times out, but a hardware reset or similar
|
|
|
|
.Dq "drastic but certain"
|
2004-02-28 20:08:41 +00:00
|
|
|
behaviour is recommended.
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr watchdog 4
|
|
|
|
.Sh AUTHORS
|
|
|
|
.An -nosplit
|
2004-07-06 07:39:50 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
facility and this manual page was written
|
2004-02-28 20:08:41 +00:00
|
|
|
.An Poul-Henning Kamp Aq phk@FreeBSD.org .
|