RTEMS 6.1-rc7
Loading...
Searching...
No Matches
corebarrierimpl.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
12/*
13 * COPYRIGHT (c) 1989-2006.
14 * On-Line Applications Research Corporation (OAR).
15 *
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions
18 * are met:
19 * 1. Redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#ifndef _RTEMS_SCORE_COREBARRIERIMPL_H
39#define _RTEMS_SCORE_COREBARRIERIMPL_H
40
42#include <rtems/score/status.h>
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
59#define CORE_BARRIER_MANUAL_RELEASE_MAXIMUM_COUNT 0
60
69
81 CORE_barrier_Control *the_barrier,
82 uint32_t maximum_count
83);
84
92static inline void _CORE_barrier_Destroy(
93 CORE_barrier_Control *the_barrier
94)
95{
96 _Thread_queue_Destroy( &the_barrier->Wait_queue );
97}
98
105static inline void _CORE_barrier_Acquire_critical(
106 CORE_barrier_Control *the_barrier,
107 Thread_queue_Context *queue_context
108)
109{
110 _Thread_queue_Acquire_critical( &the_barrier->Wait_queue, queue_context );
111}
112
119static inline void _CORE_barrier_Release(
120 CORE_barrier_Control *the_barrier,
121 Thread_queue_Context *queue_context
122)
123{
124 _Thread_queue_Release( &the_barrier->Wait_queue, queue_context );
125}
126
143 CORE_barrier_Control *the_barrier,
144 Thread_Control *executing,
145 bool wait,
146 Thread_queue_Context *queue_context
147);
148
160static inline uint32_t _CORE_barrier_Surrender(
161 CORE_barrier_Control *the_barrier,
162 Thread_queue_Context *queue_context
163)
164{
166 &the_barrier->Wait_queue.Queue,
169 queue_context
170 );
171}
172
179static inline void _CORE_barrier_Flush(
180 CORE_barrier_Control *the_barrier,
181 Thread_queue_Context *queue_context
182)
183{
185 &the_barrier->Wait_queue.Queue,
188 queue_context
189 );
190}
191
194#ifdef __cplusplus
195}
196#endif
197
198#endif
199/* end of include file */
This header file provides interfaces of the Barrier Handler which are used by the implementation and ...
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:76
const Thread_queue_Operations _CORE_barrier_Thread_queue_operations
These thread queue operations are used for core barriers.
Definition: corebarrierwait.c:68
void _CORE_barrier_Initialize(CORE_barrier_Control *the_barrier, uint32_t maximum_count)
Initializes the core barrier.
Definition: corebarrier.c:44
Status_Control
Status codes.
Definition: status.h:111
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:60
size_t _Thread_queue_Flush_critical(Thread_queue_Queue *queue, const Thread_queue_Operations *operations, Thread_queue_Flush_filter filter, Thread_queue_Context *queue_context)
Unblocks all threads enqueued on the thread queue.
Definition: threadqflush.c:86
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:49
This header file provides the interfaces of the Operation Status Support.
This control block is used to manage a barrier.
Definition: corebarrier.h:64
Thread_queue_Control Wait_queue
This member is used to manage the set of tasks which are blocked waiting for the barrier to be releas...
Definition: corebarrier.h:69
Thread queue context for the thread queue methods.
Definition: threadq.h:216
Thread_queue_Queue Queue
The actual thread queue.
Definition: threadq.h:640
The thread queue operations are used to manage the threads of a thread queue.
Definition: threadq.h:554
Definition: thread.h:837
This header file provides interfaces of the Thread Queue Handler which are only used by the implement...