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 | |
---|
26 | STATIC 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 | |
---|
45 | STATIC 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 | |
---|
60 | STATIC 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 | |
---|
75 | STATIC 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 | |
---|
90 | STATIC 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 | |
---|
103 | STATIC 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 | |
---|
116 | STATIC INLINE void _Watchdog_Insert_ticks( |
---|
117 | Watchdog_Control *the_watchdog, |
---|
118 | Watchdog_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 | |
---|
135 | STATIC INLINE void _Watchdog_Insert_seconds( |
---|
136 | Watchdog_Control *the_watchdog, |
---|
137 | Watchdog_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 | |
---|
154 | STATIC INLINE void _Watchdog_Adjust_seconds( |
---|
155 | Watchdog_Adjust_directions direction, |
---|
156 | Watchdog_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 | |
---|
170 | STATIC INLINE void _Watchdog_Adjust_ticks( |
---|
171 | Watchdog_Adjust_directions direction, |
---|
172 | Watchdog_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 | |
---|
186 | STATIC 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 | |
---|
207 | STATIC 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 | |
---|
222 | STATIC 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 | |
---|
237 | STATIC 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 | */ |
---|
251 | STATIC 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 */ |
---|