source: rtems/cpukit/score/src/watchdogadjust.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: 2.0 KB
Line 
1/*
2 *  Watchdog Handler
3 *
4 *
5 *  COPYRIGHT (c) 1989-1999.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 */
12
13#if HAVE_CONFIG_H
14#include "config.h"
15#endif
16
17#include <rtems/system.h>
18#include <rtems/score/isr.h>
19#include <rtems/score/watchdog.h>
20
21/*
22 *  _Watchdog_Adjust
23 *
24 *  This routine adjusts the delta chain backward or forward in response
25 *  to a time change.
26 *
27 *  Input parameters:
28 *    header    - pointer to the delta chain to be adjusted
29 *    direction - forward or backward adjustment to delta chain
30 *    units     - units to adjust
31 *
32 *  Output parameters:
33 */
34
35void _Watchdog_Adjust(
36  Chain_Control               *header,
37  Watchdog_Adjust_directions   direction,
38  Watchdog_Interval            units
39)
40{
41  ISR_Level level;
42
43  _ISR_Disable( level );
44
45  /*
46   * NOTE: It is safe NOT to make 'header' a pointer
47   *       to volatile data (contrast this with watchdoginsert.c)
48   *       because we call _Watchdog_Tickle() below and
49   *       hence the compiler must not assume *header to remain
50   *       unmodified across that call.
51   *
52   *       Till Straumann, 7/2003
53   */
54  if ( !_Chain_Is_empty( header ) ) {
55    switch ( direction ) {
56      case WATCHDOG_BACKWARD:
57        _Watchdog_First( header )->delta_interval += units;
58        break;
59      case WATCHDOG_FORWARD:
60        while ( units ) {
61          if ( units < _Watchdog_First( header )->delta_interval ) {
62            _Watchdog_First( header )->delta_interval -= units;
63            break;
64          } else {
65            units -= _Watchdog_First( header )->delta_interval;
66            _Watchdog_First( header )->delta_interval = 1;
67
68            _ISR_Enable( level );
69
70            _Watchdog_Tickle( header );
71
72            _ISR_Disable( level );
73
74            if ( _Chain_Is_empty( header ) )
75              break;
76          }
77        }
78        break;
79    }
80  }
81
82  _ISR_Enable( level );
83
84}
Note: See TracBrowser for help on using the repository browser.