Changeset 5f930f0 in rtems


Ignore:
Timestamp:
Jul 17, 2009, 2:21:28 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
9c4db573
Parents:
ebe76f94
Message:

2009-07-17 Joel Sherrill <joel.sherrill@…>

  • score/src/watchdogadjusttochain.c: Correct bug in recent rework. Coverage not impacted.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rebe76f94 r5f930f0  
     12009-07-17      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * score/src/watchdogadjusttochain.c: Correct bug in recent rework.
     4        Coverage not impacted.
     5
    162009-07-13      Sebastian Huber <sebastian.huber@embedded-brains.de>
    27
  • cpukit/score/src/watchdogadjusttochain.c

    rebe76f94 r5f930f0  
    3434  Watchdog_Control  *first;
    3535 
    36   if ( !units )
     36  if ( units <= 0 ) {
    3737    return;
     38  }
    3839 
    3940  _ISR_Disable( level );
    4041
    41   if ( !_Chain_Is_empty( header ) ) {
    42     while ( units ) {
    43       first = _Watchdog_First( header );
     42  while ( 1 ) {
     43    if ( units <= 0 ) {
     44      break;
     45    }
     46    if ( _Chain_Is_empty( header ) ) {
     47      break;
     48    }
     49    first = _Watchdog_First( header );
    4450
    45       /*
    46        *  If it is longer than "units" until the first element on the chain
    47        *  fires, then bump it and quit.
    48        */
    49       if ( units < first->delta_interval ) {
    50         first->delta_interval -= units;
    51         break;
    52       }
     51    /*
     52     *  If it is longer than "units" until the first element on the chain
     53     *  fires, then bump it and quit.
     54     */
     55    if ( units < first->delta_interval ) {
     56      first->delta_interval -= units;
     57      break;
     58    }
    5359
    54       /*
    55        *  The first set happens in less than units, so take all of them
    56        *  off the chain and adjust units to reflect this.
    57        */
    58       units -= first->delta_interval;
    59       first->delta_interval = 0;
     60    /*
     61     *  The first set happens in less than units, so take all of them
     62     *  off the chain and adjust units to reflect this.
     63     */
     64    units -= first->delta_interval;
     65    first->delta_interval = 0;
    6066
    61       while (1) {
    62         _Chain_Extract_unprotected( &first->Node );
    63         _Chain_Append_unprotected( to_fire, &first->Node );
     67    while ( 1 ) {
     68      _Chain_Extract_unprotected( &first->Node );
     69      _Chain_Append_unprotected( to_fire, &first->Node );
    6470
    6571      _ISR_Flash( level );
    66    
    67         if ( _Chain_Is_empty( header ) )
    68           break;
    69 
    70         first = _Watchdog_First( header );
    71         if ( first->delta_interval != 0 )
    72           break;
    73       }
     72 
     73      if ( _Chain_Is_empty( header ) )
     74        break;
     75      first = _Watchdog_First( header );
     76      if ( first->delta_interval != 0 )
     77        break;
    7478    }
    7579  }
     80
    7681  _ISR_Enable( level );
    7782}
Note: See TracChangeset for help on using the changeset viewer.