source: rtems/cpukit/score/src/watchdogtickle.c @ a6eef8b

Last change on this file since a6eef8b was a6eef8b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:52:48

2003-09-04 Joel Sherrill <joel@…>

  • apiext.c, chain.c, coremsg.c, coremsgbroadcast.c, coremsgclose.c, coremsgflush.c, coremsgflushsupp.c, coremsgflushwait.c, coremsginsert.c, coremsgseize.c, coremsgsubmit.c, coremutex.c, coremutexflush.c, coremutexseize.c, coremutexsurrender.c, coresem.c, coresemflush.c, coresemseize.c, coresemsurrender.c, coretod.c, coretodset.c, coretodtickle.c, coretodtoseconds.c, coretodvalidate.c, heap.c, heapallocate.c, heapextend.c, heapfree.c, heapgetinfo.c, heapsizeofuserarea.c, heapwalk.c, interr.c, isr.c, mpci.c, object.c, objectallocate.c, objectallocatebyindex.c, objectclearname.c, objectcomparenameraw.c, objectcomparenamestring.c, objectcopynameraw.c, objectcopynamestring.c, objectextendinformation.c, objectfree.c, objectget.c, objectgetbyindex.c, objectgetisr.c, objectgetnext.c, objectgetnoprotection.c, objectinitializeinformation.c, objectmp.c, objectnametoid.c, objectshrinkinformation.c, thread.c, threadchangepriority.c, threadclearstate.c, threadclose.c, threadcreateidle.c, threaddelayended.c, threaddispatch.c, threadevaluatemode.c, threadget.c, threadhandler.c, threadidlebody.c, threadinitialize.c, threadloadenv.c, threadmp.c, threadq.c, threadqdequeue.c, threadqdequeuefifo.c, threadqdequeuepriority.c, threadqenqueue.c, threadqenqueuefifo.c, threadqenqueuepriority.c, threadqextract.c, threadqextractfifo.c, threadqextractpriority.c, threadqextractwithproxy.c, threadqfirst.c, threadqfirstfifo.c, threadqfirstpriority.c, threadqflush.c, threadqtimeout.c, threadready.c, threadreset.c, threadresettimeslice.c, threadrestart.c, threadresume.c, threadrotatequeue.c, threadsetpriority.c, threadsetstate.c, threadsettransient.c, threadstackallocate.c, threadstackfree.c, threadstart.c, threadstartmultitasking.c, threadsuspend.c, threadtickletimeslice.c, threadyieldprocessor.c, userext.c, watchdog.c, watchdogadjust.c, watchdoginsert.c, watchdogremove.c, watchdogtickle.c, wkspace.c: URL for license changed.
  • Property mode set to 100644
File size: 2.2 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 *  $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  ISR_Level level;
37  Watchdog_Control *the_watchdog;
38  Watchdog_States  watchdog_state;
39
40  /*
41   * See the comment in watchdoginsert.c and watchdogadjust.c
42   * about why it's safe not to declare header a pointer to
43   * volatile data - till, 2003/7
44   */
45
46  _ISR_Disable( level );
47
48  if ( _Chain_Is_empty( header ) )
49    goto leave;
50
51  the_watchdog = _Watchdog_First( header );
52  the_watchdog->delta_interval--;
53  if ( the_watchdog->delta_interval != 0 )
54    goto leave;
55
56  do {
57         watchdog_state = _Watchdog_Remove( the_watchdog );
58
59         _ISR_Enable( level );
60
61     switch( watchdog_state ) {
62       case WATCHDOG_ACTIVE:
63         (*the_watchdog->routine)(
64           the_watchdog->id,
65           the_watchdog->user_data
66         );
67         break;
68
69       case WATCHDOG_INACTIVE:
70         /*
71          *  This state indicates that the watchdog is not on any chain.
72          *  Thus, it is NOT on a chain being tickled.  This case should
73          *  never occur.
74          */
75         break;
76
77       case WATCHDOG_BEING_INSERTED:
78         /*
79          *  This state indicates that the watchdog is in the process of
80          *  BEING inserted on the chain.  Thus, it can NOT be on a chain
81          *  being tickled.  This case should never occur.
82          */
83         break;
84
85       case WATCHDOG_REMOVE_IT:
86         break;
87     }
88
89         _ISR_Disable( level );
90
91     the_watchdog = _Watchdog_First( header );
92   } while ( !_Chain_Is_empty( header ) &&
93             (the_watchdog->delta_interval == 0) );
94
95leave:
96   _ISR_Enable(level);
97}
Note: See TracBrowser for help on using the repository browser.