source: rtems/c/src/exec/score/macros/watchdog.inl @ 84b7e72a

4.104.114.84.95
Last change on this file since 84b7e72a was 88d594a, checked in by Joel Sherrill <joel.sherrill@…>, on 05/24/95 at 21:39:42

Fully tested on all in-house targets

  • Property mode set to 100644
File size: 3.2 KB
Line 
1/*  watchdog.inl
2 *
3 *  This file contains the macro implementation of all inlined routines
4 *  in the Watchdog Handler.
5 *
6 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
7 *  On-Line Applications Research Corporation (OAR).
8 *  All rights assigned to U.S. Government, 1994.
9 *
10 *  This material may be reproduced by or for the U.S. Government pursuant
11 *  to the copyright license under the clause at DFARS 252.227-7013.  This
12 *  notice must appear in all copies of this file and its derivatives.
13 *
14 *  $Id$
15 */
16
17#ifndef __WATCHDOG_inl
18#define __WATCHDOG_inl
19
20#include <rtems/object.h>
21
22/*PAGE
23 *
24 *  _Watchdog_Initialize
25 *
26 */
27
28#define _Watchdog_Initialize( _the_watchdog, _routine, _id, _user_data )  \
29  { \
30    (_the_watchdog)->state     = WATCHDOG_INACTIVE; \
31    (_the_watchdog)->routine   = (_routine); \
32    (_the_watchdog)->id        = (_id); \
33    (_the_watchdog)->user_data = (_user_data); \
34  }
35
36/*PAGE
37 *
38 *  _Watchdog_Is_active
39 *
40 */
41
42#define _Watchdog_Is_active( _the_watchdog ) \
43  ( (_the_watchdog)->state == WATCHDOG_ACTIVE )
44
45/*PAGE
46 *
47 *  _Watchdog_Activate
48 *
49 */
50
51#define _Watchdog_Activate( _the_watchdog ) \
52  (_the_watchdog)->state = WATCHDOG_ACTIVE
53
54/*PAGE
55 *
56 *  _Watchdog_Deactivate
57 *
58 */
59
60#define _Watchdog_Deactivate( _the_watchdog ) \
61  (_the_watchdog)->state = WATCHDOG_REMOVE_IT
62
63/*PAGE
64 *
65 *  _Watchdog_Tickle_ticks
66 *
67 */
68
69#define _Watchdog_Tickle_ticks() \
70  _Watchdog_Tickle( &_Watchdog_Ticks_chain )
71
72/*PAGE
73 *
74 *  _Watchdog_Tickle_seconds
75 *
76 */
77
78#define _Watchdog_Tickle_seconds() \
79  _Watchdog_Tickle( &_Watchdog_Seconds_chain )
80
81/*PAGE
82 *
83 *  _Watchdog_Insert_ticks
84 *
85 */
86
87#define _Watchdog_Insert_ticks( _the_watchdog, _units, _insert_mode ) \
88  { \
89    (_the_watchdog)->initial = (_units); \
90    _Watchdog_Insert( &_Watchdog_Ticks_chain, \
91                        (_the_watchdog), (_insert_mode) ); \
92  }
93
94/*PAGE
95 *
96 *  _Watchdog_Insert_seconds
97 *
98 */
99
100#define _Watchdog_Insert_seconds( _the_watchdog, _units, _insert_mode ) \
101  { \
102    (_the_watchdog)->initial = (_units); \
103    _Watchdog_Insert( &_Watchdog_Seconds_chain, \
104                        (_the_watchdog), (_insert_mode) ); \
105  }
106
107/*PAGE
108 *
109 *  _Watchdog_Adjust_seconds
110 *
111 */
112
113#define _Watchdog_Adjust_seconds( _direction, _units ) \
114  _Watchdog_Adjust( &_Watchdog_Seconds_chain, (_direction), (_units) )
115
116/*PAGE
117 *
118 *  _Watchdog_Adjust_ticks
119 *
120 */
121
122#define _Watchdog_Adjust_ticks( _direction, _units ) \
123  _Watchdog_Adjust( &_Watchdog_Ticks_chain, (_direction), (_units) )
124
125/*PAGE
126 *
127 *  _Watchdog_Reset
128 *
129 */
130
131#define _Watchdog_Reset( _the_watchdog ) \
132   { \
133     (void) _Watchdog_Remove( (_the_watchdog) ); \
134     _Watchdog_Insert( &_Watchdog_Ticks_chain, \
135                         (_the_watchdog), WATCHDOG_ACTIVATE_NOW ); \
136   }
137
138/*PAGE
139 *
140 *  _Watchdog_Next
141 *
142 */
143
144#define _Watchdog_Next( _watchdog ) \
145  ((Watchdog_Control *) (_watchdog)->Node.next)
146
147/*PAGE
148 *
149 *  _Watchdog_Previous
150 *
151 */
152
153#define _Watchdog_Previous( _watchdog ) \
154  ((Watchdog_Control *) (_watchdog)->Node.previous)
155
156/*PAGE
157 *
158 *  _Watchdog_First
159 *
160 */
161
162#define _Watchdog_First( _header ) \
163  ((Watchdog_Control *) (_header)->first)
164
165/*PAGE
166 *
167 *  _Watchdog_Last
168 *
169 */
170
171#define _Watchdog_Last( _header ) \
172  ((Watchdog_Control *) (_header)->last)
173
174#endif
175/* end of include file */
Note: See TracBrowser for help on using the repository browser.