source: rtems/c/src/exec/score/inline/watchdog.inl @ 88d594a

4.104.114.84.95
Last change on this file since 88d594a 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.8 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  rtems_timer_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  rtems_interval      units,
119  Watchdog_Insert_modes  insert_mode
120)
121{
122
123  the_watchdog->initial = units;
124
125  _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog, insert_mode );
126
127}
128
129/*PAGE
130 *
131 *  _Watchdog_Insert_seconds
132 *
133 */
134
135STATIC INLINE void _Watchdog_Insert_seconds(
136  Watchdog_Control      *the_watchdog,
137  rtems_interval      units,
138  Watchdog_Insert_modes  insert_mode
139)
140{
141
142  the_watchdog->initial = units;
143
144  _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog, insert_mode );
145
146}
147
148/*PAGE
149 *
150 *  _Watchdog_Adjust_seconds
151 *
152 */
153
154STATIC INLINE void _Watchdog_Adjust_seconds(
155  Watchdog_Adjust_directions direction,
156  rtems_interval          units
157)
158{
159
160  _Watchdog_Adjust( &_Watchdog_Seconds_chain, direction, units );
161
162}
163
164/*PAGE
165 *
166 *  _Watchdog_Adjust_ticks
167 *
168 */
169
170STATIC INLINE void _Watchdog_Adjust_ticks(
171  Watchdog_Adjust_directions direction,
172  rtems_interval          units
173)
174{
175
176  _Watchdog_Adjust( &_Watchdog_Ticks_chain, direction, units );
177
178}
179
180/*PAGE
181 *
182 *  _Watchdog_Reset
183 *
184 */
185
186STATIC INLINE void _Watchdog_Reset(
187  Watchdog_Control *the_watchdog
188)
189{
190
191  (void) _Watchdog_Remove( the_watchdog );
192
193  _Watchdog_Insert(
194    &_Watchdog_Ticks_chain,
195    the_watchdog,
196    WATCHDOG_ACTIVATE_NOW
197  );
198
199}
200
201/*PAGE
202 *
203 *  _Watchdog_Next
204 *
205 */
206
207STATIC INLINE Watchdog_Control *_Watchdog_Next(
208  Watchdog_Control *the_watchdog
209)
210{
211
212  return ( (Watchdog_Control *) the_watchdog->Node.next );
213
214}
215
216/*PAGE
217 *
218 *  _Watchdog_Previous
219 *
220 */
221
222STATIC INLINE Watchdog_Control *_Watchdog_Previous(
223  Watchdog_Control *the_watchdog
224)
225{
226
227  return ( (Watchdog_Control *) the_watchdog->Node.previous );
228
229}
230
231/*PAGE
232 *
233 *  _Watchdog_First
234 *
235 */
236
237STATIC INLINE Watchdog_Control *_Watchdog_First(
238  Chain_Control *header
239)
240{
241
242  return ( (Watchdog_Control *) header->first );
243
244}
245
246/*PAGE
247 *
248 *  _Watchdog_Last
249 *
250 */
251STATIC INLINE Watchdog_Control *_Watchdog_Last(
252  Chain_Control *header
253)
254{
255
256  return ( (Watchdog_Control *) header->last );
257
258}
259
260#endif
261/* end of include file */
Note: See TracBrowser for help on using the repository browser.