source: rtems/cpukit/include/rtems/rtems/attrimpl.h @ 6b5f22dc

Last change on this file since 6b5f22dc was 6b5f22dc, checked in by Sebastian Huber <sebastian.huber@…>, on 11/26/20 at 10:45:47

rtems: Canonicalize Doxygen @file comments

Use common phrases for the file brief descriptions.

Update #3706.

  • Property mode set to 100644
File size: 6.8 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup RTEMSImplClassicAttr
5 *
6 * @brief This header file provides the implementation interfaces of
7 *   the @ref RTEMSImplClassicAttr support.
8 */
9
10/*
11 *  COPYRIGHT (c) 1989-2008.
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_RTEMS_ATTR_INL
20#define _RTEMS_RTEMS_ATTR_INL
21
22#include <rtems/rtems/attr.h>
23#include <rtems/score/cpu.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/**
30 * @defgroup RTEMSImplClassicAttr Directive Attributes
31 *
32 * @ingroup RTEMSImplClassic
33 *
34 * @brief This group contains the implementation to support directive
35 *   attributes.
36 *
37 * @{
38 */
39
40/****************** Forced Attributes in Configuration ****************/
41
42/**
43 *  This attribute constant indicates the attributes that are not
44 *  supportable given the hardware configuration.
45 */
46#define ATTRIBUTES_NOT_SUPPORTED       0
47
48/**
49 *  This attribute constant indicates the attributes that are
50 *  required given the hardware configuration.
51 */
52#if ( CPU_ALL_TASKS_ARE_FP == TRUE )
53#define ATTRIBUTES_REQUIRED            RTEMS_FLOATING_POINT
54#else
55#define ATTRIBUTES_REQUIRED            0
56#endif
57
58/**
59 *  @brief Sets the requested new_attributes in the attribute_set passed in.
60 *
61 *  This function sets the requested new_attributes in the attribute_set
62 *  passed in.  The result is returned to the user.
63 */
64RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Set (
65   rtems_attribute new_attributes,
66   rtems_attribute attribute_set
67)
68{
69  return attribute_set | new_attributes;
70}
71
72/**
73 *  @brief Clears the requested new_attributes in the attribute_set
74 *  passed in.
75 *
76 *  This function clears the requested new_attributes in the attribute_set
77 *  passed in.  The result is returned to the user.
78 */
79RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Clear (
80   rtems_attribute attribute_set,
81   rtems_attribute mask
82)
83{
84  return attribute_set & ~mask;
85}
86
87/**
88 *  @brief Checks if the floating point attribute is
89 *  enabled in the attribute_set.
90 *
91 *  This function returns TRUE if the floating point attribute is
92 *  enabled in the attribute_set and FALSE otherwise.
93 */
94RTEMS_INLINE_ROUTINE bool _Attributes_Is_floating_point(
95  rtems_attribute attribute_set
96)
97{
98   return ( attribute_set & RTEMS_FLOATING_POINT ) ? true : false;
99}
100
101#if defined(RTEMS_MULTIPROCESSING)
102/**
103 *  @brief Checks if the global object attribute is enabled in
104 *  the attribute_set.
105 *
106 *  This function returns TRUE if the global object attribute is
107 *  enabled in the attribute_set and FALSE otherwise.
108 */
109RTEMS_INLINE_ROUTINE bool _Attributes_Is_global(
110  rtems_attribute attribute_set
111)
112{
113   return ( attribute_set & RTEMS_GLOBAL ) ? true : false;
114}
115#endif
116
117/**
118 *  @brief Checks if the priority attribute is enabled in the attribute_set.
119 *
120 *  This function returns TRUE if the priority attribute is
121 *  enabled in the attribute_set and FALSE otherwise.
122 */
123RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority(
124  rtems_attribute attribute_set
125)
126{
127   return ( attribute_set & RTEMS_PRIORITY ) ? true : false;
128}
129
130/**
131 *  @brief Checks if the binary semaphore attribute is
132 *  enabled in the attribute_set.
133 *
134 *  This function returns TRUE if the binary semaphore attribute is
135 *  enabled in the attribute_set and FALSE otherwise.
136 */
137RTEMS_INLINE_ROUTINE bool _Attributes_Is_binary_semaphore(
138  rtems_attribute attribute_set
139)
140{
141  return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_BINARY_SEMAPHORE);
142}
143
144/**
145 *  @brief Checks if the simple binary semaphore attribute is
146 *  enabled in the attribute_set
147 *
148 *  This function returns TRUE if the simple binary semaphore attribute is
149 *  enabled in the attribute_set and FALSE otherwise.
150 */
151RTEMS_INLINE_ROUTINE bool _Attributes_Is_simple_binary_semaphore(
152  rtems_attribute attribute_set
153)
154{
155  return
156    ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_SIMPLE_BINARY_SEMAPHORE);
157}
158
159/**
160 *  @brief Checks if the counting semaphore attribute is
161 *  enabled in the attribute_set
162 *
163 *  This function returns TRUE if the counting semaphore attribute is
164 *  enabled in the attribute_set and FALSE otherwise.
165 */
166RTEMS_INLINE_ROUTINE bool _Attributes_Is_counting_semaphore(
167  rtems_attribute attribute_set
168)
169{
170  return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_COUNTING_SEMAPHORE);
171}
172
173/**
174 *  @brief Checks if the priority inheritance attribute
175 *  is enabled in the attribute_set
176 *
177 *  This function returns TRUE if the priority inheritance attribute
178 *  is enabled in the attribute_set and FALSE otherwise.
179 */
180RTEMS_INLINE_ROUTINE bool _Attributes_Is_inherit_priority(
181  rtems_attribute attribute_set
182)
183{
184   return ( attribute_set & RTEMS_INHERIT_PRIORITY ) ? true : false;
185}
186
187/**
188 * @brief Returns true if the attribute set has at most one protocol, and false
189 * otherwise.
190 *
191 * The protocols are RTEMS_INHERIT_PRIORITY, RTEMS_PRIORITY_CEILING and
192 * RTEMS_MULTIPROCESSOR_RESOURCE_SHARING.
193 */
194RTEMS_INLINE_ROUTINE bool _Attributes_Has_at_most_one_protocol(
195  rtems_attribute attribute_set
196)
197{
198  attribute_set &= RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY_CEILING
199    | RTEMS_MULTIPROCESSOR_RESOURCE_SHARING;
200
201  return ( attribute_set & ( attribute_set - 1 ) ) == 0;
202}
203
204/**
205 *  @brief Checks if the priority ceiling attribute
206 *  is enabled in the attribute_set
207 *
208 *  This function returns TRUE if the priority ceiling attribute
209 *  is enabled in the attribute_set and FALSE otherwise.
210 */
211RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority_ceiling(
212  rtems_attribute attribute_set
213)
214{
215   return ( attribute_set & RTEMS_PRIORITY_CEILING ) ? true : false;
216}
217
218/**
219 *  @brief Checks if the Multiprocessor Resource Sharing Protocol attribute
220 *  is enabled in the attribute_set
221 *
222 *  This function returns TRUE if the Multiprocessor Resource Sharing Protocol
223 *  attribute is enabled in the attribute_set and FALSE otherwise.
224 */
225RTEMS_INLINE_ROUTINE bool _Attributes_Is_multiprocessor_resource_sharing(
226  rtems_attribute attribute_set
227)
228{
229  return ( attribute_set & RTEMS_MULTIPROCESSOR_RESOURCE_SHARING ) != 0;
230}
231
232/**
233 *  @brief Checks if the barrier automatic release
234 *  attribute is enabled in the attribute_set
235 *
236 *  This function returns TRUE if the barrier automatic release
237 *  attribute is enabled in the attribute_set and FALSE otherwise.
238 */
239RTEMS_INLINE_ROUTINE bool _Attributes_Is_barrier_automatic(
240  rtems_attribute attribute_set
241)
242{
243   return ( attribute_set & RTEMS_BARRIER_AUTOMATIC_RELEASE ) ? true : false;
244}
245
246/**
247 *  @brief Checks if the system task attribute
248 *  is enabled in the attribute_set.
249 *
250 *  This function returns TRUE if the system task attribute
251 *  is enabled in the attribute_set and FALSE otherwise.
252 */
253RTEMS_INLINE_ROUTINE bool _Attributes_Is_system_task(
254  rtems_attribute attribute_set
255)
256{
257   return ( attribute_set & RTEMS_SYSTEM_TASK ) ? true : false;
258}
259
260/**@}*/
261
262#ifdef __cplusplus
263}
264#endif
265
266#endif
267/* end of include file */
Note: See TracBrowser for help on using the repository browser.