From f23d4706169d68d3c4e90b297650f89c272716f4 Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Thu, 9 Jun 2016 11:33:15 -0400 Subject: cpukit: Add and use Watchdog_Discipline. Clock disciplines may be WATCHDOG_RELATIVE, WATCHDOG_ABSOLUTE, or WATCHDOG_NO_TIMEOUT. A discipline of WATCHDOG_RELATIVE with a timeout of WATCHDOG_NO_TIMEOUT is equivalent to a discipline of WATCHDOG_NO_TIMEOUT. updates #2732 --- cpukit/score/include/rtems/score/watchdog.h | 40 +++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 8 deletions(-) (limited to 'cpukit/score/include/rtems/score/watchdog.h') diff --git a/cpukit/score/include/rtems/score/watchdog.h b/cpukit/score/include/rtems/score/watchdog.h index c582dbd1ae..11a5974c26 100644 --- a/cpukit/score/include/rtems/score/watchdog.h +++ b/cpukit/score/include/rtems/score/watchdog.h @@ -52,6 +52,38 @@ typedef struct Watchdog_Control Watchdog_Control; */ typedef uint32_t Watchdog_Interval; +/** + * @brief The clock discipline to use for the Watchdog timeout interval. + */ +typedef enum { + + /** + * @brief Indefinite wait. + * + * This is to indicate there is no timeout and not to use a watchdog. It + * must be equal to 0, which is an illegal relative clock interval, so that + * it may be used as a Watchdog_Interval value with WATCHDOG_RELATIVE to + * express an indefinite wait. + */ + WATCHDOG_NO_TIMEOUT = 0, + + /** + * @brief Relative clock. + * + * The reference time point for the watchdog is current ticks value + * during insert. Time is measured in clock ticks. + */ + WATCHDOG_RELATIVE, + + /** + * @brief Absolute clock. + * + * The reference time point for this header is the POSIX Epoch. Time is + * measured in nanoseconds since POSIX Epoch. + */ + WATCHDOG_ABSOLUTE +} Watchdog_Discipline; + /** * @brief Return type from a Watchdog Service Routine. * @@ -67,14 +99,6 @@ typedef void Watchdog_Service_routine; typedef Watchdog_Service_routine ( *Watchdog_Service_routine_entry )( Watchdog_Control * ); -/** - * @brief The constant for indefinite wait. - * - * This is the constant for indefinite wait. It is actually an - * illegal interval. - */ -#define WATCHDOG_NO_TIMEOUT 0 - /** * @brief The watchdog header to manage scheduled watchdogs. */ -- cgit v1.2.3