source: rtems/c/src/exec/score/src/watchdogtickle.c @ df49c60

4.104.114.84.95
Last change on this file since df49c60 was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34

Updated copyright notice.

  • Property mode set to 100644
File size: 1.8 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.OARcorp.com/rtems/license.html.
11 *
12 *  $Id$
13 */
14
15#include <rtems/system.h>
16#include <rtems/score/isr.h>
17#include <rtems/score/watchdog.h>
18
19/*PAGE
20 *
21 *  _Watchdog_Tickle
22 *
23 *  This routine decrements the delta counter in response to a tick.  The
24 *  delta chain is updated accordingly.
25 *
26 *  Input parameters:
27 *    header - pointer to the delta chain to be tickled
28 *
29 *  Output parameters: NONE
30 */
31
32void _Watchdog_Tickle(
33  Chain_Control *header
34)
35{
36  Watchdog_Control *the_watchdog;
37
38  if ( _Chain_Is_empty( header ) )
39    return;
40
41  the_watchdog = _Watchdog_First( header );
42  the_watchdog->delta_interval--;
43  if ( the_watchdog->delta_interval != 0 )
44    return;
45
46  do {
47     switch( _Watchdog_Remove( the_watchdog ) ) {
48       case WATCHDOG_ACTIVE:
49         (*the_watchdog->routine)(
50           the_watchdog->id,
51           the_watchdog->user_data
52         );
53         break;
54
55       case WATCHDOG_INACTIVE:
56         /*
57          *  This state indicates that the watchdog is not on any chain.
58          *  Thus, it is NOT on a chain being tickled.  This case should
59          *  never occur.
60          */
61         break;
62
63       case WATCHDOG_BEING_INSERTED:
64         /*
65          *  This state indicates that the watchdog is in the process of
66          *  BEING inserted on the chain.  Thus, it can NOT be on a chain
67          *  being tickled.  This case should never occur.
68          */
69         break;
70
71       case WATCHDOG_REMOVE_IT:
72         break;
73     }
74     the_watchdog = _Watchdog_First( header );
75   } while ( !_Chain_Is_empty( header ) &&
76             (the_watchdog->delta_interval == 0) );
77}
Note: See TracBrowser for help on using the repository browser.