OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [score/] [src/] [watchdogtickle.c] - Blame information for rev 587

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
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: watchdogtickle.c,v 1.2 2001-09-27 11:59:34 chris Exp $
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
 
32
void _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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.