RTEMS: cpukit/include/rtems/score/corebarrierimpl.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
corebarrierimpl.h
Go to the documentation of this file.
1
12/*
13 * COPYRIGHT (c) 1989-2006.
14 * On-Line Applications Research Corporation (OAR).
15 *
16 * The license and distribution terms for this file may be
17 * found in the file LICENSE in this distribution or at
18 * http://www.rtems.org/license/LICENSE.
19 */
20
21#ifndef _RTEMS_SCORE_COREBARRIERIMPL_H
22#define _RTEMS_SCORE_COREBARRIERIMPL_H
23
24#include <rtems/score/corebarrier.h>
25#include <rtems/score/status.h>
26#include <rtems/score/threadqimpl.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
45extern const Thread_queue_Operations _CORE_barrier_Thread_queue_operations;
46
55void _CORE_barrier_Initialize(
56 CORE_barrier_Control *the_barrier,
57 CORE_barrier_Attributes *the_barrier_attributes
58);
59
67 RTEMS_INLINE_ROUTINE void _CORE_barrier_Destroy(
68 CORE_barrier_Control *the_barrier
69)
70{
71 _Thread_queue_Destroy( &the_barrier->Wait_queue );
72}
73
80 RTEMS_INLINE_ROUTINE void _CORE_barrier_Acquire_critical(
81 CORE_barrier_Control *the_barrier,
82 Thread_queue_Context *queue_context
83)
84{
85 _Thread_queue_Acquire_critical( &the_barrier->Wait_queue, queue_context );
86}
87
94 RTEMS_INLINE_ROUTINE void _CORE_barrier_Release(
95 CORE_barrier_Control *the_barrier,
96 Thread_queue_Context *queue_context
97)
98{
99 _Thread_queue_Release( &the_barrier->Wait_queue, queue_context );
100}
101
117Status_Control _CORE_barrier_Seize(
118 CORE_barrier_Control *the_barrier,
119 Thread_Control *executing,
120 bool wait,
121 Thread_queue_Context *queue_context
122);
123
131uint32_t _CORE_barrier_Do_flush(
132 CORE_barrier_Control *the_barrier,
133 Thread_queue_Flush_filter filter,
134 Thread_queue_Context *queue_context
135);
136
148 RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Surrender(
149 CORE_barrier_Control *the_barrier,
150 Thread_queue_Context *queue_context
151)
152{
153 return _CORE_barrier_Do_flush(
154 the_barrier,
155 _Thread_queue_Flush_default_filter,
156 queue_context
157 );
158}
159
166 RTEMS_INLINE_ROUTINE void _CORE_barrier_Flush(
167 CORE_barrier_Control *the_barrier,
168 Thread_queue_Context *queue_context
169)
170{
171 _CORE_barrier_Do_flush(
172 the_barrier,
173 _Thread_queue_Flush_status_object_was_deleted,
174 queue_context
175 );
176}
177
189 RTEMS_INLINE_ROUTINE bool _CORE_barrier_Is_automatic(
190 CORE_barrier_Attributes *the_attribute
191)
192{
193 return
194 (the_attribute->discipline == CORE_BARRIER_AUTOMATIC_RELEASE);
195}
196
207 RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Get_number_of_waiting_threads(
208 CORE_barrier_Control *the_barrier
209)
210{
211 return the_barrier->number_of_waiting_threads;
212}
213
216#ifdef __cplusplus
217}
218#endif
219
220#endif
221/* end of include file */
corebarrier.h
Constants and Structures Associated with the Barrier Handler.
_CORE_barrier_Surrender
RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Surrender(CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
Manually releases the barrier.
Definition: corebarrierimpl.h:148
_CORE_barrier_Get_number_of_waiting_threads
RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Get_number_of_waiting_threads(CORE_barrier_Control *the_barrier)
Returns the number of currently waiting threads.
Definition: corebarrierimpl.h:207
_CORE_barrier_Is_automatic
RTEMS_INLINE_ROUTINE bool _CORE_barrier_Is_automatic(CORE_barrier_Attributes *the_attribute)
Checks if the barrier is automatic.
Definition: corebarrierimpl.h:189
_CORE_barrier_Seize
Status_Control _CORE_barrier_Seize(CORE_barrier_Control *the_barrier, Thread_Control *executing, bool wait, Thread_queue_Context *queue_context)
Waits for the barrier.
Definition: corebarrierwait.c:55
_CORE_barrier_Thread_queue_operations
const Thread_queue_Operations _CORE_barrier_Thread_queue_operations
These thread queue operations are used for core barriers.
Definition: corebarrierwait.c:47
_CORE_barrier_Release
RTEMS_INLINE_ROUTINE void _CORE_barrier_Release(CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
Releases core barrier.
Definition: corebarrierimpl.h:94
_CORE_barrier_Acquire_critical
RTEMS_INLINE_ROUTINE void _CORE_barrier_Acquire_critical(CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
Acquires critical core barrier.
Definition: corebarrierimpl.h:80
_CORE_barrier_Initialize
void _CORE_barrier_Initialize(CORE_barrier_Control *the_barrier, CORE_barrier_Attributes *the_barrier_attributes)
Initializes the core barrier.
Definition: corebarrier.c:23
_CORE_barrier_Destroy
RTEMS_INLINE_ROUTINE void _CORE_barrier_Destroy(CORE_barrier_Control *the_barrier)
Destroys the core barrier.
Definition: corebarrierimpl.h:67
_CORE_barrier_Do_flush
uint32_t _CORE_barrier_Do_flush(CORE_barrier_Control *the_barrier, Thread_queue_Flush_filter filter, Thread_queue_Context *queue_context)
Flushes the barrier.
Definition: corebarrierrelease.c:24
_CORE_barrier_Flush
RTEMS_INLINE_ROUTINE void _CORE_barrier_Flush(CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
Flushes the barrier using _CORE_barrier_Do_flush().
Definition: corebarrierimpl.h:166
CORE_BARRIER_AUTOMATIC_RELEASE
@ CORE_BARRIER_AUTOMATIC_RELEASE
Definition: corebarrier.h:50
RTEMS_INLINE_ROUTINE
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
_Thread_queue_Release
RTEMS_INLINE_ROUTINE void _Thread_queue_Release(Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context)
Releases the thread queue control and enables interrupts.
Definition: threadqimpl.h:787
Thread_queue_Flush_filter
Thread_Control *(* Thread_queue_Flush_filter)(Thread_Control *the_thread, Thread_queue_Queue *queue, Thread_queue_Context *queue_context)
Thread queue flush filter function.
Definition: threadqimpl.h:1223
_Thread_queue_Acquire_critical
RTEMS_INLINE_ROUTINE void _Thread_queue_Acquire_critical(Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context)
Acquires the thread queue control in a critical section.
Definition: threadqimpl.h:681
_Thread_queue_Destroy
RTEMS_INLINE_ROUTINE void _Thread_queue_Destroy(Thread_queue_Control *the_thread_queue)
Destroys the thread queue.
Definition: threadqimpl.h:1378
_Thread_queue_Flush_status_object_was_deleted
Thread_Control * _Thread_queue_Flush_status_object_was_deleted(Thread_Control *the_thread, Thread_queue_Queue *queue, Thread_queue_Context *queue_context)
Status object was deleted thread queue flush filter function.
Definition: threadqflush.c:37
_Thread_queue_Flush_default_filter
Thread_Control * _Thread_queue_Flush_default_filter(Thread_Control *the_thread, Thread_queue_Queue *queue, Thread_queue_Context *queue_context)
Default thread queue flush filter function.
Definition: threadqflush.c:26
CORE_barrier_Attributes
Definition: corebarrier.h:61
CORE_barrier_Attributes::discipline
CORE_barrier_Disciplines discipline
Definition: corebarrier.h:64
CORE_barrier_Control
Definition: corebarrier.h:75
CORE_barrier_Control::number_of_waiting_threads
uint32_t number_of_waiting_threads
Definition: corebarrier.h:86
CORE_barrier_Control::Wait_queue
Thread_queue_Control Wait_queue
Definition: corebarrier.h:79
Thread_queue_Context
Thread queue context for the thread queue methods.
Definition: threadq.h:198
Thread_queue_Operations
Thread queue operations.
Definition: threadq.h:518
_Thread_Control
Definition: thread.h:732
threadqimpl.h
Constants and Structures Associated with the Manipulation of Objects.