source: rtems/cpukit/rtems/include/rtems/rtems/barrier.h @ b8fc260f

4.115
Last change on this file since b8fc260f was b8fc260f, checked in by Joel Sherrill <joel.sherrill@…>, on 12/28/12 at 15:48:37

Miscellaneous Doxygen clean-up

  • Property mode set to 100644
File size: 6.0 KB
Line 
1/**
2 * @file rtems/rtems/barrier.h
3 *
4 * @brief Constants and Structures Associated with the Barrier Manager
5 *
6 *  This include file contains all the constants and structures associated
7 *  with the Barrier Manager.
8 *
9 *  Directives provided are:
10 *
11 *    - create a barrier
12 *    - get an ID of a barrier
13 *    - delete a barrier
14 *    - wait for a barrier
15 *    - signal a barrier
16 */
17
18/*  COPYRIGHT (c) 1989-2008.
19 *  On-Line Applications Research Corporation (OAR).
20 *
21 *  The license and distribution terms for this file may be
22 *  found in the file LICENSE in this distribution or at
23 *  http://www.rtems.com/license/LICENSE.
24 */
25
26#ifndef _RTEMS_RTEMS_BARRIER_H
27#define _RTEMS_RTEMS_BARRIER_H
28
29/**
30 *  @defgroup ClassicBarrier Barriers
31 *
32 *  @ingroup ClassicRTEMS
33 *
34 *  This encapsulates functionality which implements the Classic API
35 *  Barrier Manager.
36 */
37/**@{*/
38
39/**
40 *  @brief Instantiate Barrier Data
41 *
42 *  Barrier Manager -- Instantiate Data
43 *
44 *  This constant is defined to extern most of the time when using
45 *  this header file.  However by defining it to nothing, the data
46 *  declared in this header file can be instantiated.  This is done
47 *  in a single per manager file.
48 */
49#ifndef RTEMS_BARRIER_EXTERN
50#define RTEMS_BARRIER_EXTERN extern
51#endif
52
53#ifdef __cplusplus
54extern "C" {
55#endif
56
57#include <rtems/rtems/types.h>
58#include <rtems/rtems/support.h>
59#include <rtems/rtems/attr.h>
60#include <rtems/rtems/status.h>
61#include <rtems/score/object.h>
62#include <rtems/score/corebarrier.h>
63
64/**
65 *  This type defines the control block used to manage each barrier.
66 */
67typedef struct {
68  /** This is used to manage a barrier as an object. */
69  Objects_Control          Object;
70  /** This is used to specify the attributes of a barrier. */
71  rtems_attribute          attribute_set;
72  /** This is used to implement the barrier. */
73  CORE_barrier_Control     Barrier;
74}   Barrier_Control;
75
76/**
77 *  The following defines the information control block used to manage
78 *  this class of objects.
79 */
80RTEMS_BARRIER_EXTERN Objects_Information  _Barrier_Information;
81
82/**
83 *  @brief _Barrier_Manager_initialization
84 *
85 *  This routine performs the initialization necessary for this manager.
86 */
87void _Barrier_Manager_initialization(void);
88
89/**
90 *  @brief RTEMS Create Barrier
91 *
92 *  Barrier Manager -- Create a Barrier Instance
93 *
94 *  This routine implements the rtems_barrier_create directive.  The
95 *  barrier will have the name name.  The starting count for
96 *  the barrier is count.  The attribute_set determines if
97 *  the barrier is global or local and the thread queue
98 *  discipline.  It returns the id of the created barrier in ID.
99 *
100 *  @param[in] name is the name of this barrier instance.
101 *  @param[in] attribute_set specifies the attributes of this barrier instance.
102 *  @param[in] maximum_waiters is the maximum number of threads which will
103 *             be allowed to concurrently wait at the barrier.
104 *  @param[out] id will contain the id of this barrier.
105 *
106 *  @return a status code indicating success or the reason for failure.
107 */
108rtems_status_code rtems_barrier_create(
109  rtems_name           name,
110  rtems_attribute      attribute_set,
111  uint32_t             maximum_waiters,
112  rtems_id            *id
113);
114
115/**
116 *  @brief RTEMS Barrier name to Id
117 *
118 *  This routine implements the rtems_barrier_ident directive.
119 *  This directive returns the barrier ID associated with name.
120 *  If more than one barrier is named name, then the barrier
121 *  to which the ID belongs is arbitrary.  node indicates the
122 *  extent of the search for the ID of the barrier named name.
123 *  The search can be limited to a particular node or allowed to
124 *  encompass all nodes.
125 *
126 *  @param[in] name is the name of this barrier instance.
127 *  @param[out] id will contain the id of this barrier.
128 *
129 *  @return a status code indicating success or the reason for failure.
130 */
131rtems_status_code rtems_barrier_ident(
132  rtems_name    name,
133  rtems_id     *id
134);
135
136/**
137 *  @brief RTEMS Delete Barrier
138 *
139 *  This routine implements the rtems_barrier_delete directive.  The
140 *  barrier indicated by @a id is deleted.  The barrier is freed back to the
141 *  inactive barrier chain.
142 *
143 *
144 *  @param[in] id indicates the barrier to delete
145 *
146 *  @return a status code indicating success or the reason for failure.
147 */
148rtems_status_code rtems_barrier_delete(
149  rtems_id   id
150);
151
152/**
153 *  @brief RTEMS Barrier Wait
154 *
155 *  This routine implements the rtems_barrier_wait directive.  It
156 *  attempts to wait at the barrier associated with @a id.  The calling task
157 *  may block waiting for the barrier with an optional timeout of @a timeout
158 *  clock ticks.
159 *
160 *  @param[in] id indicates the barrier to wait at.
161 *  @param[in] timeout is the maximum length of time in ticks the calling
162 *             thread is willing to block.
163 *
164 *  @return a status code indicating success or the reason for failure.
165 */
166rtems_status_code rtems_barrier_wait(
167  rtems_id       id,
168  rtems_interval timeout
169);
170
171/**
172 *  @brief RTEMS Barrier Release
173 *
174 *  Barrier Manager -- Release Tasks Waitng at a Barrier
175 *
176 *  This routine implements the rtems_barrier_release directive.  It
177 *  unblocks all of the threads waiting on the barrier associated with
178 *  @a id.  The number of threads unblocked is returned in @a released.
179 *
180 *
181 *  @param[in] id indicates the barrier to wait at.
182 *  @param[out] released will contain the number of threads unblocked.
183 *
184 *  @return a status code indicating success or the reason for failure.
185 */
186rtems_status_code rtems_barrier_release(
187  rtems_id  id,
188  uint32_t *released
189);
190
191/**
192 *  @brief Translate SuperCore Barrier Status Code to RTEMS Status Code
193 *
194 *  This function returns a RTEMS status code based on the barrier
195 *  status code specified.
196 *
197 *  @param[in] the_status is the SuperCore Barrier status to translate.
198 *
199 *  @return a status code indicating success or the reason for failure.
200 */
201rtems_status_code _Barrier_Translate_core_barrier_return_code (
202  CORE_barrier_Status  the_status
203);
204
205#ifndef __RTEMS_APPLICATION__
206#include <rtems/rtems/barrier.inl>
207#endif
208
209#ifdef __cplusplus
210}
211#endif
212
213/**@}*/
214
215#endif
216/*  end of include file */
Note: See TracBrowser for help on using the repository browser.