source: rtems/cpukit/libcsupport/include/chain.h @ bce9f3b1

Last change on this file since bce9f3b1 was 9f6c063, checked in by Joel Sherrill <joel.sherrill@…>, on 10/12/01 at 21:10:49

2001-10-12 Joel Sherrill <joel@…>

  • include/chain.h: Fixed typo.
  • Property mode set to 100644
File size: 8.8 KB
Line 
1/*  chain.h
2 *
3 *  This include file contains all the constants and structures associated
4 *  with doubly linked chains.  This file actually just provides an
5 *  interface to the chain object in rtems.
6 *
7 *  COPYRIGHT (c) 1989-1997.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  The license and distribution terms for this file may in
11 *  the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 * $ld:
15 */
16
17#ifndef __CHAIN_h
18#define __CHAIN_h
19
20#include <rtems.h>
21
22/*
23 *  Chain_Initialize
24 *
25 *  This routine initializes the_chain structure to manage the
26 *  contiguous array of number_nodes nodes which starts at
27 *  starting_address.  Each node is of node_size bytes.
28 *
29 *  Chain_Control                    *the_chain,                 * IN  *
30 *  void                             *starting_address,          * IN  *
31 *  rtems_unsigned32                  number_nodes,              * IN  *
32 *  rtems_unsigned32                  node_size                  * IN  *
33 */
34
35#define Chain_Initialize( the_chain, starting_address, \
36                          number_nodes, node_size ) \
37       _Chain_Initialize( the_chain, starting_address, \
38                          number_nodes, node_size ) \
39
40
41/*
42 *  Chain_Initialize_empty
43 *
44 *  This routine initializes the specified chain to contain zero nodes.
45 *
46 *  Chain_Control                    *the_chain                  * IN  *
47 */
48
49#define Chain_Initialize_empty( the_chain ) \
50       _Chain_Initialize_empty( the_chain )
51 
52
53/*
54 *  Chain_Are_nodes_equal
55 *
56 *  This function returns TRUE if LEFT and RIGHT are equal,
57 *  and FALSE otherwise.
58 *
59 *  Chain_Node                       *left,                      * IN  *
60 *  Chain_Node                       *right                      * IN  *
61 */
62 
63#define Chain_Are_nodes_equal( left, right ) \
64       _Chain_Are_nodes_equal( left, right )
65
66
67/*
68 *  Chain_Extract_unprotected
69 *
70 *  This routine extracts the_node from the chain on which it resides.
71 *  It does NOT disable interrupts to insure the atomicity of the
72 *  extract operation.
73 *
74 *  Chain_Node                       *the_node                   * IN  *
75 */
76
77#define Chain_Extract_unprotected( the_node ) \
78       _Chain_Extract_unprotected( the_node )
79
80
81/*
82 *  Chain_Extract
83 *
84 *  This routine extracts the_node from the chain on which it resides.
85 *  It disables interrupts to insure the atomicity of the
86 *  extract operation.
87 *
88 *  Chain_Node                       *the_node                   * IN  *
89 */
90
91#define Chain_Extract( the_node ) \
92       _Chain_Extract( the_node )
93
94
95/*
96 *  Chain_Get_unprotected
97 *
98 *  This function removes the first node from the_chain and returns
99 *  a pointer to that node.  If the_chain is empty, then NULL is returned.
100 *  It does NOT disable interrupts to insure the atomicity of the
101 *  get operation.
102 *
103 *  Chain_Control                    *the_chain                  * IN  *
104 */
105
106#define Chain_Get_unprotected( the_chain ) \
107       _Chain_Get_unprotected( the_chain )
108
109
110/*
111 *  Chain_Get
112 *
113 *  This function removes the first node from the_chain and returns
114 *  a pointer to that node.  If the_chain is empty, then NULL is returned.
115 *  It disables interrupts to insure the atomicity of the
116 *  get operation.
117 *
118 *  Chain_Control                    *the_chain                  * IN  *
119 */
120
121#define Chain_Get( the_chain ) \
122       _Chain_Get( the_chain )
123
124
125/*
126 *  Chain_Get_first_unprotected
127 *
128 *  This function removes the first node from the_chain and returns
129 *  a pointer to that node.  It does NOT disable interrupts to insure
130 *  the atomicity of the get operation.
131 *
132 *  Chain_Control                    *the_chain                  * IN  *
133 */
134
135#define Chain_Get_first_unprotected( the_chain ) \
136       _Chain_Get_first_unprotected( the_chain )
137
138
139/*
140 *  Chain_Insert_unprotected
141 *
142 *  This routine inserts the_node on a chain immediately following
143 *  after_node.  It does NOT disable interrupts to insure the atomicity
144 *  of the extract operation.
145 *
146 *  Chain_Node                       *after_node,                * IN  *
147 *  Chain_Node                       *the_node                   * IN  *
148 */
149
150#define Chain_Insert_unprotected( after_node, the_node ) \
151       _Chain_Insert_unprotected( after_node, the_node )
152
153
154/*
155 *  Chain_Insert
156 *
157 *  This routine inserts the_node on a chain immediately following
158 *  after_node.  It disables interrupts to insure the atomicity
159 *  of the extract operation.
160 *
161 *  Chain_Node                       *after_node,                * IN  *
162 *  Chain_Node                       *the_node                   * IN  *
163 */
164
165#define Chain_Insert( after_node, the_node ) \
166       _Chain_Insert( after_node, the_node )
167
168
169/*
170 *  Chain_Append_unprotected
171 *
172 *  This routine appends the_node onto the end of the_chain.
173 *  It does NOT disable interrupts to insure the atomicity of the
174 *  append operation.
175 *
176 *  Chain_Control                    *the_chain,                 * IN  *
177 *  Chain_Node                       *the_node                   * IN  *
178 */
179
180#define Chain_Append_unprotected( the_chain, the_node ) \
181       _Chain_Append_unprotected( the_chain, the_node )
182
183
184/*
185 *  Chain_Append
186 *
187 *  This routine appends the_node onto the end of the_chain.
188 *  It disables interrupts to insure the atomicity of the
189 *  append operation.
190 *
191 *  Chain_Control                    *the_chain,                 * IN  *
192 *  Chain_Node                       *the_node                   * IN  *
193 */
194
195#define Chain_Append( the_chain, the_node ) \
196       _Chain_Append( the_chain, the_node )
197
198
199/*
200 *  Chain_Prepend_unprotected
201 *
202 *  This routine prepends the_node onto the front of the_chain.
203 *  It does NOT disable interrupts to insure the atomicity of the
204 *  prepend operation.
205 *
206 *  Chain_Control                    *the_chain,                 * IN  *
207 *  Chain_Node                       *the_node                   * IN  *
208 */
209
210#define Chain_Prepend_unprotected( the_chain, the_node ) \
211       _Chain_Prepend_unprotected( the_chain, the_node )
212
213
214/*
215 *  Chain_Prepend
216 *
217 *  This routine prepends the_node onto the front of the_chain.
218 *  It disables interrupts to insure the atomicity of the
219 *  prepend operation.
220 *
221 *  Chain_Control                    *the_chain,                 * IN  *
222 *  Chain_Node                       *the_node                   * IN  *
223 */
224
225#define Chain_Prepend( the_chain, the_node ) \
226       _Chain_Prepend( the_chain, the_node )
227
228
229/*
230 *  Chain_Head
231 *
232 *  This function returns a pointer to the first node on the chain.
233 *
234 *  Chain_Control                    *the_chain                  * IN  *
235 */
236
237#define Chain_Head( the_chain ) \
238       _Chain_Head( the_chain )
239
240
241/*
242 *  Chain_Tail
243 *
244 *  This function returns a pointer to the last node on the chain.
245 *
246 *  Chain_Control                    *the_chain                  * IN  *
247 */
248
249#define Chain_Tail( the_chain ) \
250       _Chain_Tail( the_chain )
251
252
253/*
254 *  Chain_Is_head
255 *
256 *  This function returns TRUE if the_node is the head of the_chain and
257 *  FALSE otherwise.
258 *
259 *  Chain_Control                    *the_chain,                 * IN  *
260 *  Chain_Node                       *the_node                   * IN  *
261 */
262
263#define Chain_Is_head( the_chain, the_node ) \
264       _Chain_Is_head( the_chain, the_node )
265
266
267/*
268 *  Chain_Is_tail
269 *
270 *  This function returns TRUE if the_node is the tail of the_chain and
271 *  FALSE otherwise.
272 *
273 *  Chain_Control                    *the_chain,                 * IN  *
274 *  Chain_Node                       *the_node                   * IN  *
275 */
276
277#define Chain_Is_tail( the_chain, the_node ) \
278       _Chain_Is_tail( the_chain, the_node )
279
280
281/*
282 *  Chain_Is_first
283 *
284 *  This function returns TRUE if the_node is the first node on a chain and
285 *  FALSE otherwise.
286 *
287 *  Chain_Node                       *the_node                   * IN  *
288 */
289
290#define Chain_Is_first( the_node ) \
291       _Chain_Is_first( the_node )
292
293
294/*
295 *  Chain_Is_last
296 *
297 *  This function returns TRUE if the_node is the last node on a chain and
298 *  FALSE otherwise.
299 *
300 *  Chain_Node                       *the_node                   * IN  *
301 */
302
303#define Chain_Is_last( the_node ) \
304       _Chain_Is_last( the_node )
305
306
307/*
308 *  Chain_Is_empty
309 *
310 *  This function returns TRUE if there are no nodes on the_chain and
311 *  FALSE otherwise.
312 *
313 *  Chain_Control                    *the_chain                  * IN  *
314 */
315
316#define Chain_Is_empty( the_chain ) \
317       _Chain_Is_empty( the_chain )
318
319
320/*
321 *  Chain_Has_only_one_node
322 *
323 *  This function returns TRUE if there is only one node on the_chain and
324 *  FALSE otherwise.
325 *
326 *  Chain_Control                    *the_chain                  * IN  *
327 */
328
329#define Chain_Has_only_one_node( the_chain ) \
330       _Chain_Has_only_one_node( the_chain )
331
332
333/*
334 *  Chain_Is_null
335 *
336 *  This function returns TRUE if the_chain is NULL and FALSE otherwise.
337 *
338 *  Chain_Control                    *the_chain                  * IN  *
339 */
340
341#define Chain_Is_null( the_chain ) \
342       _Chain_Is_null( the_chain )
343
344
345/*
346 *  Chain_Is_null_node
347 *
348 *  This function returns TRUE if the_node is NULL and FALSE otherwise.
349 *
350 *  Chain_Node                       *the_node                   * IN  *
351 */
352
353#define Chain_Is_null_node( the_node ) \
354       _Chain_Is_null_node( the_node )
355
356
357#undef __RTEMS_APPLICATION__
358#include <rtems/score/chain.inl>
359#define __RTEMS_APPLICATION__
360#endif
361/* end of include file */
Note: See TracBrowser for help on using the repository browser.