RTEMS: cpukit/include/rtems/rtems/attrimpl.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
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
25extern "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
60 RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Set (
61 rtems_attribute new_attributes,
62 rtems_attribute attribute_set
63)
64{
65 return attribute_set | new_attributes;
66}
67
75 RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Clear (
76 rtems_attribute attribute_set,
77 rtems_attribute mask
78)
79{
80 return attribute_set & ~mask;
81}
82
90 RTEMS_INLINE_ROUTINE bool _Attributes_Is_floating_point(
91 rtems_attribute attribute_set
92)
93{
94 return ( attribute_set & RTEMS_FLOATING_POINT ) ? true : false;
95}
96
97#if defined(RTEMS_MULTIPROCESSING)
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
119 RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority(
120 rtems_attribute attribute_set
121)
122{
123 return ( attribute_set & RTEMS_PRIORITY ) ? true : false;
124}
125
133 RTEMS_INLINE_ROUTINE bool _Attributes_Is_binary_semaphore(
134 rtems_attribute attribute_set
135)
136{
137 return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_BINARY_SEMAPHORE);
138}
139
147 RTEMS_INLINE_ROUTINE bool _Attributes_Is_simple_binary_semaphore(
148 rtems_attribute attribute_set
149)
150{
151 return
152 ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_SIMPLE_BINARY_SEMAPHORE);
153}
154
162 RTEMS_INLINE_ROUTINE bool _Attributes_Is_counting_semaphore(
163 rtems_attribute attribute_set
164)
165{
166 return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_COUNTING_SEMAPHORE);
167}
168
176 RTEMS_INLINE_ROUTINE bool _Attributes_Is_inherit_priority(
177 rtems_attribute attribute_set
178)
179{
180 return ( attribute_set & RTEMS_INHERIT_PRIORITY ) ? true : false;
181}
182
190 RTEMS_INLINE_ROUTINE bool _Attributes_Has_at_most_one_protocol(
191 rtems_attribute attribute_set
192)
193{
194 attribute_set &= RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY_CEILING
195 | RTEMS_MULTIPROCESSOR_RESOURCE_SHARING;
196
197 return ( attribute_set & ( attribute_set - 1 ) ) == 0;
198}
199
207 RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority_ceiling(
208 rtems_attribute attribute_set
209)
210{
211 return ( attribute_set & RTEMS_PRIORITY_CEILING ) ? true : false;
212}
213
221 RTEMS_INLINE_ROUTINE bool _Attributes_Is_multiprocessor_resource_sharing(
222 rtems_attribute attribute_set
223)
224{
225 return ( attribute_set & RTEMS_MULTIPROCESSOR_RESOURCE_SHARING ) != 0;
226}
227
235 RTEMS_INLINE_ROUTINE bool _Attributes_Is_barrier_automatic(
236 rtems_attribute attribute_set
237)
238{
239 return ( attribute_set & RTEMS_BARRIER_AUTOMATIC_RELEASE ) ? true : false;
240}
241
249 RTEMS_INLINE_ROUTINE bool _Attributes_Is_system_task(
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 */
attr.h
_Attributes_Is_floating_point
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
_Attributes_Is_inherit_priority
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
_Attributes_Is_system_task
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
_Attributes_Is_barrier_automatic
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
_Attributes_Is_simple_binary_semaphore
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
_Attributes_Is_priority
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
_Attributes_Is_multiprocessor_resource_sharing
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
_Attributes_Set
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
_Attributes_Is_priority_ceiling
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
_Attributes_Is_binary_semaphore
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
_Attributes_Has_at_most_one_protocol
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
_Attributes_Clear
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
_Attributes_Is_counting_semaphore
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
RTEMS_COUNTING_SEMAPHORE
#define RTEMS_COUNTING_SEMAPHORE
Definition: attr.h:97
RTEMS_GLOBAL
#define RTEMS_GLOBAL
Definition: attr.h:55
RTEMS_SEMAPHORE_CLASS
#define RTEMS_SEMAPHORE_CLASS
Definition: attr.h:91
RTEMS_INHERIT_PRIORITY
#define RTEMS_INHERIT_PRIORITY
Definition: attr.h:123
RTEMS_SYSTEM_TASK
#define RTEMS_SYSTEM_TASK
Definition: attr.h:179
RTEMS_BINARY_SEMAPHORE
#define RTEMS_BINARY_SEMAPHORE
Definition: attr.h:103
RTEMS_MULTIPROCESSOR_RESOURCE_SHARING
#define RTEMS_MULTIPROCESSOR_RESOURCE_SHARING
Definition: attr.h:151
RTEMS_PRIORITY
#define RTEMS_PRIORITY
Definition: attr.h:67
RTEMS_PRIORITY_CEILING
#define RTEMS_PRIORITY_CEILING
Definition: attr.h:137
RTEMS_SIMPLE_BINARY_SEMAPHORE
#define RTEMS_SIMPLE_BINARY_SEMAPHORE
Definition: attr.h:109
RTEMS_FLOATING_POINT
#define RTEMS_FLOATING_POINT
Definition: attr.h:83
RTEMS_BARRIER_AUTOMATIC_RELEASE
#define RTEMS_BARRIER_AUTOMATIC_RELEASE
Definition: attr.h:159
rtems_attribute
uint32_t rtems_attribute
Definition: attr.h:41
RTEMS_INLINE_ROUTINE
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66