diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-04-10 15:51:50 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-04-13 13:08:55 +0200 |
commit | bcf536a50a0563b854773cb45bc0fd7b19cd5c51 (patch) | |
tree | bf613e7459c487dc8cc64ba28e2ff5cbc3a08d70 /cpukit/score/include/rtems/score | |
parent | bsp/altera-cyclone-v: Add RTC driver (diff) | |
download | rtems-bcf536a50a0563b854773cb45bc0fd7b19cd5c51.tar.bz2 |
score: Split _Watchdog_Adjust()
Split _Watchdog_Adjust() into _Watchdog_Adjust_backward() and
_Watchdog_Adjust_forward(). Remove Watchdog_Adjust_directions,
_Watchdog_Adjust_seconds() and _Watchdog_Adjust_ticks(). This avoids to
check the same condition again.
Update #2307.
Diffstat (limited to 'cpukit/score/include/rtems/score')
-rw-r--r-- | cpukit/score/include/rtems/score/watchdogimpl.h | 78 |
1 files changed, 20 insertions, 58 deletions
diff --git a/cpukit/score/include/rtems/score/watchdogimpl.h b/cpukit/score/include/rtems/score/watchdogimpl.h index d50e279b40..9eb0951949 100644 --- a/cpukit/score/include/rtems/score/watchdogimpl.h +++ b/cpukit/score/include/rtems/score/watchdogimpl.h @@ -53,22 +53,6 @@ extern "C" { } /** - * @brief the manner in which a watchdog chain may - * be adjusted by the @ref _Watchdog_Adjust routine. - * - * The following enumerated type details the manner in which - * a watchdog chain may be adjusted by the @ref _Watchdog_Adjust - * routine. The direction indicates a movement FORWARD - * or BACKWARD in time. - */ -typedef enum { - /** adjust delta value forward */ - WATCHDOG_FORWARD, - /** adjust delta value backward */ - WATCHDOG_BACKWARD -} Watchdog_Adjust_directions; - -/** * @brief Watchdog synchronization level. * * This used for synchronization purposes @@ -121,20 +105,29 @@ Watchdog_States _Watchdog_Remove ( ); /** - * @brief Adjusts the @a header watchdog chain in the forward - * or backward @a direction for @a units ticks. + * @brief Adjusts the header watchdog chain in the backward direction for + * units ticks. * - * This routine adjusts the @a header watchdog chain in the forward - * or backward @a direction for @a units ticks. + * @param[in] header The watchdog chain. + * @param[in] units The units of ticks to adjust. + */ +void _Watchdog_Adjust_backward( + Chain_Control *header, + Watchdog_Interval units +); + +/** + * @brief Adjusts the header watchdog chain in the forward direction for units + * ticks. * - * @param[in] header is the watchdog chain to adjust - * @param[in] direction is the direction to adjust @a header - * @param[in] units is the number of units to adjust @a header + * This may lead to several _Watchdog_Tickle() invocations. + * + * @param[in] header The watchdog chain. + * @param[in] units The units of ticks to adjust. */ -void _Watchdog_Adjust ( - Chain_Control *header, - Watchdog_Adjust_directions direction, - Watchdog_Interval units +void _Watchdog_Adjust_forward( + Chain_Control *header, + Watchdog_Interval units ); /** @@ -312,37 +305,6 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Insert_seconds( } /** - * This routine adjusts the seconds watchdog chain in the forward - * or backward DIRECTION for UNITS seconds. This is invoked when the - * current time of day is changed. - */ - -RTEMS_INLINE_ROUTINE void _Watchdog_Adjust_seconds( - Watchdog_Adjust_directions direction, - Watchdog_Interval units -) -{ - - _Watchdog_Adjust( &_Watchdog_Seconds_chain, direction, units ); - -} - -/** - * This routine adjusts the ticks watchdog chain in the forward - * or backward DIRECTION for UNITS ticks. - */ - -RTEMS_INLINE_ROUTINE void _Watchdog_Adjust_ticks( - Watchdog_Adjust_directions direction, - Watchdog_Interval units -) -{ - - _Watchdog_Adjust( &_Watchdog_Ticks_chain, direction, units ); - -} - -/** * This routine resets THE_WATCHDOG timer to its state at INSERT * time. This routine is valid only on interval watchdog timers * and is used to make an interval watchdog timer fire "every" so |