RTEMS
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 */
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_INHERIT_PRIORITY
This attribute constant indicates that the Classic API Semaphore object shall use the Priority Inheri...
Definition: attr.h:185
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_SYSTEM_TASK
This attribute constant is used to indicate that the Classic API Task object shall be a system task...
Definition: attr.h:302
#define RTEMS_MULTIPROCESSOR_RESOURCE_SHARING
This attribute constant indicates that the Classic API Semaphore object shall use the Multiprocessor ...
Definition: attr.h:207
#define RTEMS_COUNTING_SEMAPHORE
This attribute constant indicates that the Classic API Semaphore object shall be a counting semaphore...
Definition: attr.h:131
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
#define RTEMS_PRIORITY
This attribute constant indicates that the Classic API object shall manage blocking tasks using the t...
Definition: attr.h:260
#define RTEMS_SIMPLE_BINARY_SEMAPHORE
This attribute constant indicates that the Classic API Semaphore object shall be a simple binary sema...
Definition: attr.h:292
This header file defines attributes provided by the Classic API.
#define RTEMS_BINARY_SEMAPHORE
This attribute constant indicates that the Classic API Semaphore object shall be a proper binary sema...
Definition: attr.h:121
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_FLOATING_POINT
This attribute constant indicates that the task shall be able to use the floating point hardware...
Definition: attr.h:163
#define RTEMS_SEMAPHORE_CLASS
This is the mask for the attribute bits associated with the Classic API Semaphore Manager...
Definition: attr.h:282
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
SPARC CPU Department Source.
uint32_t rtems_attribute
This type is used to represent Classic API attributes.
Definition: attr.h:91
#define RTEMS_PRIORITY_CEILING
This attribute constant indicates that the Classic API Semaphore object shall use the Priority Ceilin...
Definition: attr.h:272
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_BARRIER_AUTOMATIC_RELEASE
This attribute constant indicates that a Classic API Barrier object shall use the automatic release p...
Definition: attr.h:101
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_INLINE_ROUTINE
Gives a hint to the compiler in a function declaration to inline this function.
Definition: basedefs.h:683
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_GLOBAL
This attribute constant indicates that the Classic API object shall be a global resource in a multipr...
Definition: attr.h:173
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