RTEMS  5.1
attrimpl.h
Go to the documentation of this file.
1 
9 /*
10  * COPYRIGHT (c) 1989-2008.
11  * On-Line Applications Research Corporation (OAR).
12  *
13  * The license and distribution terms for this file may be
14  * found in the file LICENSE in this distribution or at
15  * http://www.rtems.org/license/LICENSE.
16  */
17 
18 #ifndef _RTEMS_RTEMS_ATTR_INL
19 #define _RTEMS_RTEMS_ATTR_INL
20 
21 #include <rtems/rtems/attr.h>
22 #include <rtems/score/cpu.h>
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
36 /****************** Forced Attributes in Configuration ****************/
37 
42 #define ATTRIBUTES_NOT_SUPPORTED 0
43 
48 #if ( CPU_ALL_TASKS_ARE_FP == TRUE )
49 #define ATTRIBUTES_REQUIRED RTEMS_FLOATING_POINT
50 #else
51 #define ATTRIBUTES_REQUIRED 0
52 #endif
53 
61  rtems_attribute new_attributes,
62  rtems_attribute attribute_set
63 )
64 {
65  return attribute_set | new_attributes;
66 }
67 
76  rtems_attribute attribute_set,
77  rtems_attribute mask
78 )
79 {
80  return attribute_set & ~mask;
81 }
82 
91  rtems_attribute attribute_set
92 )
93 {
94  return ( attribute_set & RTEMS_FLOATING_POINT ) ? true : false;
95 }
96 
97 #if defined(RTEMS_MULTIPROCESSING)
98 
105 RTEMS_INLINE_ROUTINE bool _Attributes_Is_global(
106  rtems_attribute attribute_set
107 )
108 {
109  return ( attribute_set & RTEMS_GLOBAL ) ? true : false;
110 }
111 #endif
112 
120  rtems_attribute attribute_set
121 )
122 {
123  return ( attribute_set & RTEMS_PRIORITY ) ? true : false;
124 }
125 
134  rtems_attribute attribute_set
135 )
136 {
137  return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_BINARY_SEMAPHORE);
138 }
139 
148  rtems_attribute attribute_set
149 )
150 {
151  return
153 }
154 
163  rtems_attribute attribute_set
164 )
165 {
166  return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_COUNTING_SEMAPHORE);
167 }
168 
177  rtems_attribute attribute_set
178 )
179 {
180  return ( attribute_set & RTEMS_INHERIT_PRIORITY ) ? true : false;
181 }
182 
191  rtems_attribute attribute_set
192 )
193 {
196 
197  return ( attribute_set & ( attribute_set - 1 ) ) == 0;
198 }
199 
208  rtems_attribute attribute_set
209 )
210 {
211  return ( attribute_set & RTEMS_PRIORITY_CEILING ) ? true : false;
212 }
213 
222  rtems_attribute attribute_set
223 )
224 {
225  return ( attribute_set & RTEMS_MULTIPROCESSOR_RESOURCE_SHARING ) != 0;
226 }
227 
236  rtems_attribute attribute_set
237 )
238 {
239  return ( attribute_set & RTEMS_BARRIER_AUTOMATIC_RELEASE ) ? true : false;
240 }
241 
250  rtems_attribute attribute_set
251 )
252 {
253  return ( attribute_set & RTEMS_SYSTEM_TASK ) ? true : false;
254 }
255 
258 #ifdef __cplusplus
259 }
260 #endif
261 
262 #endif
263 /* end of include file */
#define RTEMS_BINARY_SEMAPHORE
Definition: attr.h:103
uint32_t rtems_attribute
Definition: attr.h:41
#define RTEMS_FLOATING_POINT
Definition: attr.h:83
RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority(rtems_attribute attribute_set)
Checks if the priority attribute is enabled in the attribute_set.
Definition: attrimpl.h:119
RTEMS_INLINE_ROUTINE bool _Attributes_Is_floating_point(rtems_attribute attribute_set)
Checks if the floating point attribute is enabled in the attribute_set.
Definition: attrimpl.h:90
RTEMS_INLINE_ROUTINE bool _Attributes_Is_simple_binary_semaphore(rtems_attribute attribute_set)
Checks if the simple binary semaphore attribute is enabled in the attribute_set.
Definition: attrimpl.h:147
#define RTEMS_SIMPLE_BINARY_SEMAPHORE
Definition: attr.h:109
RTEMS_INLINE_ROUTINE bool _Attributes_Is_system_task(rtems_attribute attribute_set)
Checks if the system task attribute is enabled in the attribute_set.
Definition: attrimpl.h:249
#define RTEMS_COUNTING_SEMAPHORE
Definition: attr.h:97
#define RTEMS_PRIORITY
Definition: attr.h:67
RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Set(rtems_attribute new_attributes, rtems_attribute attribute_set)
Sets the requested new_attributes in the attribute_set passed in.
Definition: attrimpl.h:60
RTEMS_INLINE_ROUTINE bool _Attributes_Is_multiprocessor_resource_sharing(rtems_attribute attribute_set)
Checks if the Multiprocessor Resource Sharing Protocol attribute is enabled in the attribute_set.
Definition: attrimpl.h:221
#define RTEMS_PRIORITY_CEILING
Definition: attr.h:137
#define RTEMS_GLOBAL
Definition: attr.h:55
RTEMS_INLINE_ROUTINE bool _Attributes_Is_barrier_automatic(rtems_attribute attribute_set)
Checks if the barrier automatic release attribute is enabled in the attribute_set.
Definition: attrimpl.h:235
#define RTEMS_SEMAPHORE_CLASS
Definition: attr.h:91
#define RTEMS_INHERIT_PRIORITY
Definition: attr.h:123
#define RTEMS_BARRIER_AUTOMATIC_RELEASE
Definition: attr.h:159
RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Clear(rtems_attribute attribute_set, rtems_attribute mask)
Clears the requested new_attributes in the attribute_set passed in.
Definition: attrimpl.h:75
#define RTEMS_SYSTEM_TASK
Definition: attr.h:179
RTEMS_INLINE_ROUTINE bool _Attributes_Is_counting_semaphore(rtems_attribute attribute_set)
Checks if the counting semaphore attribute is enabled in the attribute_set.
Definition: attrimpl.h:162
#define RTEMS_MULTIPROCESSOR_RESOURCE_SHARING
Definition: attr.h:151
RTEMS_INLINE_ROUTINE bool _Attributes_Has_at_most_one_protocol(rtems_attribute attribute_set)
Returns true if the attribute set has at most one protocol, and false otherwise.
Definition: attrimpl.h:190
RTEMS_INLINE_ROUTINE bool _Attributes_Is_binary_semaphore(rtems_attribute attribute_set)
Checks if the binary semaphore attribute is enabled in the attribute_set.
Definition: attrimpl.h:133
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
RTEMS_INLINE_ROUTINE bool _Attributes_Is_inherit_priority(rtems_attribute attribute_set)
Checks if the priority inheritance attribute is enabled in the attribute_set.
Definition: attrimpl.h:176
RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority_ceiling(rtems_attribute attribute_set)
Checks if the priority ceiling attribute is enabled in the attribute_set.
Definition: attrimpl.h:207