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

4.104.115
Last change on this file since db80f11 was db80f11, checked in by Joel Sherrill <joel.sherrill@…>, on 12/17/08 at 20:21:40

2008-12-17 Joel Sherrill <joel.sherrill@…>

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