source: rtems/c/src/exec/score/inline/rtems/score/watchdog.inl @ 8d0b7d96

4.104.114.84.95
Last change on this file since 8d0b7d96 was 8d0b7d96, checked in by Joel Sherrill <joel.sherrill@…>, on 12/01/95 at 22:03:55

Insert mode argument to _Watchdog_Insert removed. Now are watchdog timers
are automatically activated upon insertion.

  • Property mode set to 100644
File size: 3.7 KB
Line 
1/*  watchdog.inl
2 *
3 *  This file contains the static inline implementation of all inlined
4 *  routines 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/*PAGE
21 *
22 *  _Watchdog_Initialize
23 *
24 */
25
26STATIC INLINE void _Watchdog_Initialize(
27  Watchdog_Control               *the_watchdog,
28  Watchdog_Service_routine_entry  routine,
29  Objects_Id                      id,
30  void                           *user_data
31)
32{
33  the_watchdog->state     = WATCHDOG_INACTIVE;
34  the_watchdog->routine   = routine;
35  the_watchdog->id        = id;
36  the_watchdog->user_data = user_data;
37}
38
39/*PAGE
40 *
41 *  _Watchdog_Is_active
42 *
43 */
44
45STATIC INLINE boolean _Watchdog_Is_active(
46  Watchdog_Control *the_watchdog
47)
48{
49
50  return ( the_watchdog->state == WATCHDOG_ACTIVE );
51
52}
53
54/*PAGE
55 *
56 *  _Watchdog_Activate
57 *
58 */
59
60STATIC INLINE void _Watchdog_Activate(
61  Watchdog_Control *the_watchdog
62)
63{
64
65  the_watchdog->state = WATCHDOG_ACTIVE;
66
67}
68
69/*PAGE
70 *
71 *  _Watchdog_Deactivate
72 *
73 */
74
75STATIC INLINE void _Watchdog_Deactivate(
76  Watchdog_Control *the_watchdog
77)
78{
79
80  the_watchdog->state = WATCHDOG_REMOVE_IT;
81
82}
83
84/*PAGE
85 *
86 *  _Watchdog_Tickle_ticks
87 *
88 */
89
90STATIC INLINE void _Watchdog_Tickle_ticks( void )
91{
92
93  _Watchdog_Tickle( &_Watchdog_Ticks_chain );
94
95}
96
97/*PAGE
98 *
99 *  _Watchdog_Tickle_seconds
100 *
101 */
102
103STATIC INLINE void _Watchdog_Tickle_seconds( void )
104{
105
106  _Watchdog_Tickle( &_Watchdog_Seconds_chain );
107
108}
109
110/*PAGE
111 *
112 *  _Watchdog_Insert_ticks
113 *
114 */
115
116STATIC INLINE void _Watchdog_Insert_ticks(
117  Watchdog_Control      *the_watchdog,
118  Watchdog_Interval      units
119)
120{
121
122  the_watchdog->initial = units;
123
124  _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
125
126}
127
128/*PAGE
129 *
130 *  _Watchdog_Insert_seconds
131 *
132 */
133
134STATIC INLINE void _Watchdog_Insert_seconds(
135  Watchdog_Control      *the_watchdog,
136  Watchdog_Interval      units
137)
138{
139
140  the_watchdog->initial = units;
141
142  _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog );
143
144}
145
146/*PAGE
147 *
148 *  _Watchdog_Adjust_seconds
149 *
150 */
151
152STATIC INLINE void _Watchdog_Adjust_seconds(
153  Watchdog_Adjust_directions direction,
154  Watchdog_Interval          units
155)
156{
157
158  _Watchdog_Adjust( &_Watchdog_Seconds_chain, direction, units );
159
160}
161
162/*PAGE
163 *
164 *  _Watchdog_Adjust_ticks
165 *
166 */
167
168STATIC INLINE void _Watchdog_Adjust_ticks(
169  Watchdog_Adjust_directions direction,
170  Watchdog_Interval          units
171)
172{
173
174  _Watchdog_Adjust( &_Watchdog_Ticks_chain, direction, units );
175
176}
177
178/*PAGE
179 *
180 *  _Watchdog_Reset
181 *
182 */
183
184STATIC INLINE void _Watchdog_Reset(
185  Watchdog_Control *the_watchdog
186)
187{
188
189  (void) _Watchdog_Remove( the_watchdog );
190
191  _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
192
193}
194
195/*PAGE
196 *
197 *  _Watchdog_Next
198 *
199 */
200
201STATIC INLINE Watchdog_Control *_Watchdog_Next(
202  Watchdog_Control *the_watchdog
203)
204{
205
206  return ( (Watchdog_Control *) the_watchdog->Node.next );
207
208}
209
210/*PAGE
211 *
212 *  _Watchdog_Previous
213 *
214 */
215
216STATIC INLINE Watchdog_Control *_Watchdog_Previous(
217  Watchdog_Control *the_watchdog
218)
219{
220
221  return ( (Watchdog_Control *) the_watchdog->Node.previous );
222
223}
224
225/*PAGE
226 *
227 *  _Watchdog_First
228 *
229 */
230
231STATIC INLINE Watchdog_Control *_Watchdog_First(
232  Chain_Control *header
233)
234{
235
236  return ( (Watchdog_Control *) header->first );
237
238}
239
240/*PAGE
241 *
242 *  _Watchdog_Last
243 *
244 */
245STATIC INLINE Watchdog_Control *_Watchdog_Last(
246  Chain_Control *header
247)
248{
249
250  return ( (Watchdog_Control *) header->last );
251
252}
253
254#endif
255/* end of include file */
Note: See TracBrowser for help on using the repository browser.