1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Constants and Structures Associated with the POSIX Barrier Manager |
---|
5 | * |
---|
6 | * This include file contains all the constants and structures associated |
---|
7 | * with the POSIX Barrier Manager. |
---|
8 | * |
---|
9 | * Directives provided are: |
---|
10 | * |
---|
11 | * - create a barrier |
---|
12 | * - delete a barrier |
---|
13 | * - wait for a barrier |
---|
14 | */ |
---|
15 | |
---|
16 | /* |
---|
17 | * COPYRIGHT (c) 1989-2011. |
---|
18 | * On-Line Applications Research Corporation (OAR). |
---|
19 | * |
---|
20 | * The license and distribution terms for this file may be |
---|
21 | * found in the file LICENSE in this distribution or at |
---|
22 | * http://www.rtems.com/license/LICENSE. |
---|
23 | */ |
---|
24 | |
---|
25 | #ifndef _RTEMS_POSIX_BARRIER_H |
---|
26 | #define _RTEMS_POSIX_BARRIER_H |
---|
27 | |
---|
28 | /** |
---|
29 | * @defgroup POSIXBarrier POSIX Barriers |
---|
30 | * |
---|
31 | * @ingroup POSIXAPI |
---|
32 | * |
---|
33 | * This encapsulates functionality which implements the RTEMS API |
---|
34 | * Barrier Manager. |
---|
35 | * |
---|
36 | * @{ |
---|
37 | */ |
---|
38 | |
---|
39 | #ifdef __cplusplus |
---|
40 | extern "C" { |
---|
41 | #endif |
---|
42 | |
---|
43 | #include <rtems/score/object.h> |
---|
44 | #include <rtems/score/corebarrier.h> |
---|
45 | |
---|
46 | /** |
---|
47 | * This type defines the control block used to manage each barrier. |
---|
48 | */ |
---|
49 | |
---|
50 | typedef struct { |
---|
51 | /** This is used to manage a barrier as an object. */ |
---|
52 | Objects_Control Object; |
---|
53 | /** This is used to implement the barrier. */ |
---|
54 | CORE_barrier_Control Barrier; |
---|
55 | } POSIX_Barrier_Control; |
---|
56 | |
---|
57 | /** |
---|
58 | * The following defines the information control block used to manage |
---|
59 | * this class of objects. |
---|
60 | */ |
---|
61 | |
---|
62 | POSIX_EXTERN Objects_Information _POSIX_Barrier_Information; |
---|
63 | |
---|
64 | /** |
---|
65 | * @brief POSIX barrier manager initialization. |
---|
66 | * |
---|
67 | * This routine performs the initialization necessary for this manager. |
---|
68 | */ |
---|
69 | |
---|
70 | void _POSIX_Barrier_Manager_initialization(void); |
---|
71 | |
---|
72 | /** |
---|
73 | * @brief POSIX translate barrier return code. |
---|
74 | * |
---|
75 | * This routine translates SuperCore Barrier status codes into the |
---|
76 | * corresponding POSIX ones. |
---|
77 | * |
---|
78 | * @param[in] the_barrier_status is the SuperCore status. |
---|
79 | * |
---|
80 | * @return the corresponding POSIX status |
---|
81 | */ |
---|
82 | int _POSIX_Barrier_Translate_core_barrier_return_code( |
---|
83 | CORE_barrier_Status the_barrier_status |
---|
84 | ); |
---|
85 | |
---|
86 | #ifndef __RTEMS_APPLICATION__ |
---|
87 | #include <rtems/posix/barrier.inl> |
---|
88 | #endif |
---|
89 | |
---|
90 | /** @} */ |
---|
91 | |
---|
92 | #ifdef __cplusplus |
---|
93 | } |
---|
94 | #endif |
---|
95 | |
---|
96 | #endif |
---|
97 | /* end of include file */ |
---|