Changeset 744379e in rtems


Ignore:
Timestamp:
Jul 9, 2009, 9:56:34 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
55b891e2
Parents:
b503e0b9
Message:

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

  • score/src/watchdogadjusttochain.c: Rework to ease code coverage analysis.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rb503e0b9 r744379e  
     12009-07-09      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * score/src/watchdogadjusttochain.c: Rework to ease code coverage
     4        analysis.
     5
    162009-07-09      Joel Sherrill <joel.sherrill@OARcorp.com>
    27
  • cpukit/score/src/watchdogadjusttochain.c

    rb503e0b9 r744379e  
    55 */
    66
    7 /*  COPYRIGHT (c) 1989-2008.
     7/*  COPYRIGHT (c) 1989-2009.
    88 *  On-Line Applications Research Corporation (OAR).
    99 *
     
    3232  Watchdog_Interval  units = units_arg;
    3333  ISR_Level          level;
    34   Chain_Node        *node;
    35 
    36   if ( !units ) {
     34  Watchdog_Control  *first;
     35 
     36  if ( !units )
    3737    return;
    38   }
     38 
    3939  _ISR_Disable( level );
    4040
    4141  if ( !_Chain_Is_empty( header ) ) {
    4242    while ( units ) {
    43       if ( units < _Watchdog_First( header )->delta_interval ) {
    44         _Watchdog_First( header )->delta_interval -= units;
    45         break;
    46       } else {
    47         units -= _Watchdog_First( header )->delta_interval;
    48         _Watchdog_First( header )->delta_interval = 0;
     43      first = _Watchdog_First( header );
    4944
    50         do {
    51           node = _Chain_Get_unprotected( header );
    52           _Chain_Append_unprotected( to_fire, node );
     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      }
    5353
    54           _ISR_Flash( level );
     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;
    5560
    56         } while ( !_Chain_Is_empty( header ) &&
    57                   _Watchdog_First( header )->delta_interval == 0 );
     61      while (1) {
     62        _Chain_Extract_unprotected( &first->Node );
     63        _Chain_Append_unprotected( to_fire, &first->Node );
    5864
    59         if ( _Chain_Is_empty( header ) )
    60           break;
     65      _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;
    6173      }
    6274    }
    63 
    6475  }
    6576  _ISR_Enable( level );
Note: See TracChangeset for help on using the changeset viewer.