diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-02-18 08:36:26 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-03-04 13:36:10 +0100 |
commit | 03b900d3ed120ea919ea3eded7edbece3488cff3 (patch) | |
tree | 182781fc14fe15fd67caeb80e46f1c58495839c2 /cpukit/score/src/watchdogadjust.c | |
parent | score: Distribute clock tick to all online CPUs (diff) | |
download | rtems-03b900d3ed120ea919ea3eded7edbece3488cff3.tar.bz2 |
score: Replace watchdog handler implementation
Use a red-black tree instead of delta chains.
Close #2344.
Update #2554.
Update #2555.
Close #2606.
Diffstat (limited to 'cpukit/score/src/watchdogadjust.c')
-rw-r--r-- | cpukit/score/src/watchdogadjust.c | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/cpukit/score/src/watchdogadjust.c b/cpukit/score/src/watchdogadjust.c deleted file mode 100644 index 32b5f7990e..0000000000 --- a/cpukit/score/src/watchdogadjust.c +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @file - * - * @brief Watchdog Adjust - * @ingroup ScoreWatchdog - */ - -/* - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include <rtems/score/watchdogimpl.h> - -void _Watchdog_Adjust_backward_locked( - Watchdog_Header *header, - Watchdog_Interval units -) -{ - if ( !_Watchdog_Is_empty( header ) ) { - _Watchdog_First( header )->delta_interval += units; - } -} - -void _Watchdog_Adjust_backward( - Watchdog_Header *header, - Watchdog_Interval units -) -{ - ISR_lock_Context lock_context; - - _Watchdog_Acquire( header, &lock_context ); - _Watchdog_Adjust_backward_locked( header, units ); - _Watchdog_Release( header, &lock_context ); -} - -void _Watchdog_Adjust_forward_locked( - Watchdog_Header *header, - Watchdog_Interval units, - ISR_lock_Context *lock_context -) -{ - while ( !_Watchdog_Is_empty( header ) && units > 0 ) { - Watchdog_Control *first = _Watchdog_First( header ); - - if ( units < first->delta_interval ) { - first->delta_interval -= units; - break; - } else { - units -= first->delta_interval; - first->delta_interval = 1; - - _Watchdog_Release( header, lock_context ); - - _Watchdog_Tickle( header ); - - _Watchdog_Acquire( header, lock_context ); - } - } -} - -void _Watchdog_Adjust_forward( - Watchdog_Header *header, - Watchdog_Interval units -) -{ - ISR_lock_Context lock_context; - - _Watchdog_Acquire( header, &lock_context ); - _Watchdog_Adjust_forward_locked( header, units, &lock_context ); - _Watchdog_Release( header, &lock_context ); -} |