RTEMS CPU Kit with SuperCore  4.11.2
corebarrierimpl.h
Go to the documentation of this file.
1 
10 /*
11  * COPYRIGHT (c) 1989-2006.
12  * On-Line Applications Research Corporation (OAR).
13  *
14  * The license and distribution terms for this file may be
15  * found in the file LICENSE in this distribution or at
16  * http://www.rtems.org/license/LICENSE.
17  */
18 
19 #ifndef _RTEMS_SCORE_COREBARRIERIMPL_H
20 #define _RTEMS_SCORE_COREBARRIERIMPL_H
21 
23 #include <rtems/score/thread.h>
25 #include <rtems/score/watchdog.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
39 typedef enum {
57 
63 #define CORE_BARRIER_STATUS_LAST CORE_BARRIER_TIMEOUT
64 
72  );
73 
83  CORE_barrier_Control *the_barrier,
84  CORE_barrier_Attributes *the_barrier_attributes
85 );
86 
87 RTEMS_INLINE_ROUTINE void _CORE_barrier_Destroy(
88  CORE_barrier_Control *the_barrier
89 )
90 {
91  _Thread_queue_Destroy( &the_barrier->Wait_queue );
92 }
93 
113 void _CORE_barrier_Wait(
114  CORE_barrier_Control *the_barrier,
115  Thread_Control *executing,
116  Objects_Id id,
117  bool wait,
118  Watchdog_Interval timeout,
119  CORE_barrier_API_mp_support_callout api_barrier_mp_support
120 );
121 
135 uint32_t _CORE_barrier_Release(
136  CORE_barrier_Control *the_barrier,
137  Objects_Id id,
138  CORE_barrier_API_mp_support_callout api_barrier_mp_support
139 );
140 
150 #define _CORE_barrier_Flush( _the_barrier, _remote_extract_callout, _status) \
151  _Thread_queue_Flush( \
152  &((_the_barrier)->Wait_queue), \
153  (_remote_extract_callout), \
154  (_status) \
155  )
156 
166  CORE_barrier_Attributes *the_attribute
167 )
168 {
169  return
170  (the_attribute->discipline == CORE_BARRIER_AUTOMATIC_RELEASE);
171 }
172 
181  CORE_barrier_Control *the_barrier
182 )
183 {
184  return the_barrier->number_of_waiting_threads;
185 }
186 
189 #ifdef __cplusplus
190 }
191 #endif
192 
193 #endif
194 /* end of include file */
This status indicates that the operation completed successfully.
Definition: corebarrierimpl.h:41
void _CORE_barrier_Wait(CORE_barrier_Control *the_barrier, Thread_Control *executing, Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support)
Wait for the barrier.
Definition: corebarrierwait.c:26
void(* CORE_barrier_API_mp_support_callout)(Thread_Control *, Objects_Id)
The following type defines the callout which the API provides to support global/multiprocessor operat...
Definition: corebarrierimpl.h:69
#define RTEMS_INLINE_ROUTINE
The following (in conjunction with compiler arguments) are used to choose between the use of static i...
Definition: basedefs.h:135
Constants and Structures Associated with Watchdog Timers.
This specifies that the barrier will automatically release when the user specified number of threads ...
Definition: corebarrier.h:45
This status indicates that the barrier is configured for automatic release and the caller tripped the...
Definition: corebarrierimpl.h:46
Constants and Structures Related with the Thread Control Block.
RTEMS_INLINE_ROUTINE bool _CORE_barrier_Is_automatic(CORE_barrier_Attributes *the_attribute)
This function returns true if the automatic release attribute is enabled in the attribute_set and fal...
Definition: corebarrierimpl.h:165
This structure defines the Thread Control Block (TCB).
Definition: thread.h:671
This status indicates that the calling task was willing to block but the operation was unable to comp...
Definition: corebarrierimpl.h:55
This status indicates that the thread was blocked waiting for an operation to complete and the barrie...
Definition: corebarrierimpl.h:50
Constants and Structures Associated with the Barrier Handler.
Constants and Structures Associated with the Manipulation of Objects.
CORE_barrier_Status
Core Barrier handler return statuses.
Definition: corebarrierimpl.h:39
Thread_queue_Control Wait_queue
This field is the Waiting Queue used to manage the set of tasks which are blocked waiting for the bar...
Definition: corebarrier.h:74
uint32_t number_of_waiting_threads
This element contains the current number of thread waiting for this barrier to be released...
Definition: corebarrier.h:81
RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Get_number_of_waiting_threads(CORE_barrier_Control *the_barrier)
This routine returns the number of threads currently waiting at the barrier.
Definition: corebarrierimpl.h:180
uint32_t Watchdog_Interval
Type is used to specify the length of intervals.
Definition: watchdog.h:47
uint32_t _CORE_barrier_Release(CORE_barrier_Control *the_barrier, Objects_Id id, CORE_barrier_API_mp_support_callout api_barrier_mp_support)
Manually release the barrier.
Definition: corebarrierrelease.c:26
uint32_t Objects_Id
The following type defines the control block used to manage object IDs.
Definition: object.h:122
The following defines the control block used to manage each barrier.
Definition: corebarrier.h:70
The following defines the control block used to manage the attributes of each barrier.
Definition: corebarrier.h:56
CORE_barrier_Disciplines discipline
This field indicates whether the barrier is automatic or manual.
Definition: corebarrier.h:59
void _CORE_barrier_Initialize(CORE_barrier_Control *the_barrier, CORE_barrier_Attributes *the_barrier_attributes)
Initialize core barrier.
Definition: corebarrier.c:24