source: rtems/cpukit/score/include/rtems/score/chain.h @ dd687d97

4.104.114.84.95
Last change on this file since dd687d97 was dd687d97, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:56:05

2003-09-04 Joel Sherrill <joel@…>

  • include/rtems/debug.h, include/rtems/seterr.h, include/rtems/system.h, include/rtems/score/address.h, include/rtems/score/apiext.h, include/rtems/score/apimutex.h, include/rtems/score/bitfield.h, include/rtems/score/chain.h, include/rtems/score/context.h, include/rtems/score/copyrt.h, include/rtems/score/coremsg.h, include/rtems/score/coremutex.h, include/rtems/score/coresem.h, include/rtems/score/heap.h, include/rtems/score/interr.h, include/rtems/score/isr.h, include/rtems/score/mpci.h, include/rtems/score/mppkt.h, include/rtems/score/object.h, include/rtems/score/objectmp.h, include/rtems/score/priority.h, include/rtems/score/stack.h, include/rtems/score/states.h, include/rtems/score/sysstate.h, include/rtems/score/thread.h, include/rtems/score/threadmp.h, include/rtems/score/threadq.h, include/rtems/score/tod.h, include/rtems/score/tqdata.h, include/rtems/score/userext.h, include/rtems/score/watchdog.h, include/rtems/score/wkspace.h, inline/rtems/score/address.inl, inline/rtems/score/chain.inl, inline/rtems/score/coremsg.inl, inline/rtems/score/coremutex.inl, inline/rtems/score/coresem.inl, inline/rtems/score/heap.inl, inline/rtems/score/isr.inl, inline/rtems/score/mppkt.inl, inline/rtems/score/object.inl, inline/rtems/score/objectmp.inl, inline/rtems/score/priority.inl, inline/rtems/score/stack.inl, inline/rtems/score/states.inl, inline/rtems/score/sysstate.inl, inline/rtems/score/thread.inl, inline/rtems/score/threadmp.inl, inline/rtems/score/tod.inl, inline/rtems/score/tqdata.inl, inline/rtems/score/userext.inl, inline/rtems/score/watchdog.inl, inline/rtems/score/wkspace.inl, macros/rtems/score/address.inl, macros/rtems/score/chain.inl, macros/rtems/score/coremsg.inl, macros/rtems/score/coremutex.inl, macros/rtems/score/coresem.inl, macros/rtems/score/heap.inl, macros/rtems/score/isr.inl, macros/rtems/score/mppkt.inl, macros/rtems/score/object.inl, macros/rtems/score/objectmp.inl, macros/rtems/score/priority.inl, macros/rtems/score/stack.inl, macros/rtems/score/states.inl, macros/rtems/score/sysstate.inl, macros/rtems/score/thread.inl, macros/rtems/score/threadmp.inl, macros/rtems/score/tod.inl, macros/rtems/score/tqdata.inl, macros/rtems/score/userext.inl, macros/rtems/score/watchdog.inl, macros/rtems/score/wkspace.inl, src/apiext.c, src/chain.c, src/coremsg.c, src/coremsgbroadcast.c, src/coremsgclose.c, src/coremsgflush.c, src/coremsgflushsupp.c, src/coremsgflushwait.c, src/coremsginsert.c, src/coremsgseize.c, src/coremsgsubmit.c, src/coremutex.c, src/coremutexflush.c, src/coremutexseize.c, src/coremutexsurrender.c, src/coresem.c, src/coresemflush.c, src/coresemseize.c, src/coresemsurrender.c, src/coretod.c, src/coretodset.c, src/coretodtickle.c, src/coretodtoseconds.c, src/coretodvalidate.c, src/heap.c, src/heapallocate.c, src/heapextend.c, src/heapfree.c, src/heapgetinfo.c, src/heapsizeofuserarea.c, src/heapwalk.c, src/interr.c, src/isr.c, src/iterateoverthreads.c, src/mpci.c, src/object.c, src/objectallocate.c, src/objectallocatebyindex.c, src/objectclearname.c, src/objectcomparenameraw.c, src/objectcomparenamestring.c, src/objectcopynameraw.c, src/objectcopynamestring.c, src/objectextendinformation.c, src/objectfree.c, src/objectget.c, src/objectgetbyindex.c, src/objectgetisr.c, src/objectgetnext.c, src/objectgetnoprotection.c, src/objectidtoname.c, src/objectinitializeinformation.c, src/objectmp.c, src/objectnametoid.c, src/objectshrinkinformation.c, src/thread.c, src/threadchangepriority.c, src/threadclearstate.c, src/threadclose.c, src/threadcreateidle.c, src/threaddelayended.c, src/threaddispatch.c, src/threadevaluatemode.c, src/threadget.c, src/threadhandler.c, src/threadidlebody.c, src/threadinitialize.c, src/threadloadenv.c, src/threadmp.c, src/threadq.c, src/threadqdequeue.c, src/threadqdequeuefifo.c, src/threadqdequeuepriority.c, src/threadqenqueue.c, src/threadqenqueuefifo.c, src/threadqenqueuepriority.c, src/threadqextract.c, src/threadqextractfifo.c, src/threadqextractpriority.c, src/threadqextractwithproxy.c, src/threadqfirst.c, src/threadqfirstfifo.c, src/threadqfirstpriority.c, src/threadqflush.c, src/threadqtimeout.c, src/threadready.c, src/threadreset.c, src/threadresettimeslice.c, src/threadrestart.c, src/threadresume.c, src/threadrotatequeue.c, src/threadsetpriority.c, src/threadsetstate.c, src/threadsettransient.c, src/threadstackallocate.c, src/threadstackfree.c, src/threadstart.c, src/threadstartmultitasking.c, src/threadsuspend.c, src/threadtickletimeslice.c, src/threadyieldprocessor.c, src/userext.c, src/watchdog.c, src/watchdogadjust.c, src/watchdoginsert.c, src/watchdogremove.c, src/watchdogtickle.c, src/wkspace.c: URL for license changed.
  • Property mode set to 100644
File size: 3.6 KB
Line 
1/*  chain.h
2 *
3 *  This include file contains all the constants and structures associated
4 *  with the Doubly Linked Chain Handler.
5 *
6 *  COPYRIGHT (c) 1989-1999.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#ifndef __RTEMS_CHAIN_h
17#define __RTEMS_CHAIN_h
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include <rtems/score/address.h>
24
25/*
26 *  This is used to manage each element (node) which is placed
27 *  on a chain.
28 *
29 *  NOTE:  Typically, a more complicated structure will use the
30 *         chain package.  The more complicated structure will
31 *         include a chain node as the first element in its
32 *         control structure.  It will then call the chain package
33 *         with a pointer to that node element.  The node pointer
34 *         and the higher level structure start at the same address
35 *         so the user can cast the pointers back and forth.
36 *
37 */
38
39typedef struct Chain_Node_struct Chain_Node;
40
41struct Chain_Node_struct {
42  Chain_Node *next;
43  Chain_Node *previous;
44};
45
46/*
47 *  This is used to manage a chain.  A chain consists of a doubly
48 *  linked list of zero or more nodes.
49 *
50 *  NOTE:  This implementation does not require special checks for
51 *         manipulating the first and last elements on the chain.
52 *         To accomplish this the chain control structure is
53 *         treated as two overlapping chain nodes.  The permanent
54 *         head of the chain overlays a node structure on the
55 *         first and permanent_null fields.  The permanent tail
56 *         of the chain overlays a node structure on the
57 *         permanent_null and last elements of the structure.
58 *
59 */
60
61typedef struct {
62  Chain_Node *first;
63  Chain_Node *permanent_null;
64  Chain_Node *last;
65} Chain_Control;
66
67/*
68 *  _Chain_Initialize
69 *
70 *  DESCRIPTION:
71 *
72 *  This routine initializes the_chain structure to manage the
73 *  contiguous array of number_nodes nodes which starts at
74 *  starting_address.  Each node is of node_size bytes.
75 *
76 */
77
78void _Chain_Initialize(
79  Chain_Control *the_chain,
80  void          *starting_address,
81  unsigned32     number_nodes,
82  unsigned32     node_size
83);
84
85/*
86 *  _Chain_Get_first_unprotected
87 */
88 
89#ifndef USE_INLINES
90Chain_Node *_Chain_Get_first_unprotected(
91  Chain_Control *the_chain
92);
93#endif
94
95/*
96 *  _Chain_Extract
97 *
98 *  DESCRIPTION:
99 *
100 *  This routine extracts the_node from the chain on which it resides.
101 *  It disables interrupts to insure the atomicity of the
102 *  extract operation.
103 *
104 */
105
106void _Chain_Extract(
107  Chain_Node *the_node
108);
109
110/*
111 *  _Chain_Get
112 *
113 *  DESCRIPTION:
114 *
115 *  This function removes the first node from the_chain and returns
116 *  a pointer to that node.  If the_chain is empty, then NULL is returned.
117 *  It disables interrupts to insure the atomicity of the
118 *  get operation.
119 *
120 */
121
122Chain_Node *_Chain_Get(
123  Chain_Control *the_chain
124);
125
126/*
127 *  _Chain_Insert
128 *
129 *  DESCRIPTION:
130 *
131 *  This routine inserts the_node on a chain immediately following
132 *  after_node.  It disables interrupts to insure the atomicity
133 *  of the extract operation.
134 *
135 */
136
137void _Chain_Insert(
138  Chain_Node *after_node,
139  Chain_Node *the_node
140);
141
142/*
143 *  _Chain_Append
144 *
145 *  DESCRIPTION:
146 *
147 *  This routine appends the_node onto the end of the_chain.
148 *  It disables interrupts to insure the atomicity of the
149 *  append operation.
150 *
151 */
152
153void _Chain_Append(
154  Chain_Control *the_chain,
155  Chain_Node    *the_node
156);
157
158#ifndef __RTEMS_APPLICATION__
159#include <rtems/score/chain.inl>
160#endif
161
162#ifdef __cplusplus
163}
164#endif
165
166#endif
167/* end of include file */
Note: See TracBrowser for help on using the repository browser.