diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-17 14:21:28 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-17 14:21:28 +0000 |
commit | 5f930f07fb9fa11e081af4154ec40106305fbdd7 (patch) | |
tree | bd93b8a9444931ace59ec29c43e842497d9644f5 | |
parent | removing unneeded files (diff) | |
download | rtems-5f930f07fb9fa11e081af4154ec40106305fbdd7.tar.bz2 |
2009-07-17 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/src/watchdogadjusttochain.c: Correct bug in recent rework.
Coverage not impacted.
-rw-r--r-- | cpukit/ChangeLog | 5 | ||||
-rw-r--r-- | cpukit/score/src/watchdogadjusttochain.c | 63 |
2 files changed, 39 insertions, 29 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index be7245dddc..8303f58a09 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,8 @@ +2009-07-17 Joel Sherrill <joel.sherrill@OARcorp.com> + + * score/src/watchdogadjusttochain.c: Correct bug in recent rework. + Coverage not impacted. + 2009-07-13 Sebastian Huber <sebastian.huber@embedded-brains.de> * score/src/isrthreaddispatch.c: New file. diff --git a/cpukit/score/src/watchdogadjusttochain.c b/cpukit/score/src/watchdogadjusttochain.c index 6fedb9d0e1..0578276429 100644 --- a/cpukit/score/src/watchdogadjusttochain.c +++ b/cpukit/score/src/watchdogadjusttochain.c @@ -33,46 +33,51 @@ void _Watchdog_Adjust_to_chain( ISR_Level level; Watchdog_Control *first; - if ( !units ) + if ( units <= 0 ) { return; + } _ISR_Disable( level ); - if ( !_Chain_Is_empty( header ) ) { - while ( units ) { - first = _Watchdog_First( header ); + while ( 1 ) { + if ( units <= 0 ) { + break; + } + if ( _Chain_Is_empty( header ) ) { + break; + } + first = _Watchdog_First( header ); - /* - * If it is longer than "units" until the first element on the chain - * fires, then bump it and quit. - */ - if ( units < first->delta_interval ) { - first->delta_interval -= units; - break; - } + /* + * If it is longer than "units" until the first element on the chain + * fires, then bump it and quit. + */ + if ( units < first->delta_interval ) { + first->delta_interval -= units; + break; + } - /* - * The first set happens in less than units, so take all of them - * off the chain and adjust units to reflect this. - */ - units -= first->delta_interval; - first->delta_interval = 0; + /* + * The first set happens in less than units, so take all of them + * off the chain and adjust units to reflect this. + */ + units -= first->delta_interval; + first->delta_interval = 0; - while (1) { - _Chain_Extract_unprotected( &first->Node ); - _Chain_Append_unprotected( to_fire, &first->Node ); + while ( 1 ) { + _Chain_Extract_unprotected( &first->Node ); + _Chain_Append_unprotected( to_fire, &first->Node ); _ISR_Flash( level ); - - if ( _Chain_Is_empty( header ) ) - break; - - first = _Watchdog_First( header ); - if ( first->delta_interval != 0 ) - break; - } + + if ( _Chain_Is_empty( header ) ) + break; + first = _Watchdog_First( header ); + if ( first->delta_interval != 0 ) + break; } } + _ISR_Enable( level ); } |