source: rtems/cpukit/score/src/watchdogadjusttochain.c @ 2d7ae960

4.115
Last change on this file since 2d7ae960 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/**
2 *  @file watchdogadjusttochain.c
3 *
4 *  This is used by the Timer Server task.
5 */
6
7/*  COPYRIGHT (c) 1989-2009.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.rtems.com/license/LICENSE.
13 */
14
15#if HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <rtems/system.h>
20#include <rtems/score/isr.h>
21#include <rtems/score/watchdog.h>
22
23void _Watchdog_Adjust_to_chain(
24  Chain_Control               *header,
25  Watchdog_Interval            units_arg,
26  Chain_Control               *to_fire
27
28)
29{
30  Watchdog_Interval  units = units_arg;
31  ISR_Level          level;
32  Watchdog_Control  *first;
33
34  if ( units <= 0 ) {
35    return;
36  }
37
38  _ISR_Disable( level );
39
40  while ( 1 ) {
41    if ( units <= 0 ) {
42      break;
43    }
44    if ( _Chain_Is_empty( header ) ) {
45      break;
46    }
47    first = _Watchdog_First( header );
48
49    /*
50     *  If it is longer than "units" until the first element on the chain
51     *  fires, then bump it and quit.
52     */
53    if ( units < first->delta_interval ) {
54      first->delta_interval -= units;
55      break;
56    }
57
58    /*
59     *  The first set happens in less than units, so take all of them
60     *  off the chain and adjust units to reflect this.
61     */
62    units -= first->delta_interval;
63    first->delta_interval = 0;
64
65    while ( 1 ) {
66      _Chain_Extract_unprotected( &first->Node );
67      _Chain_Append_unprotected( to_fire, &first->Node );
68
69      _ISR_Flash( level );
70
71      if ( _Chain_Is_empty( header ) )
72        break;
73      first = _Watchdog_First( header );
74      if ( first->delta_interval != 0 )
75        break;
76    }
77  }
78
79  _ISR_Enable( level );
80}
81
Note: See TracBrowser for help on using the repository browser.