1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup ClassicAttributesImpl |
---|
5 | * |
---|
6 | * @brief Classic Attributes Implementation |
---|
7 | */ |
---|
8 | |
---|
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 | |
---|
28 | /** |
---|
29 | * @defgroup ClassicAttributesImpl Classic Attributes Implementation |
---|
30 | * |
---|
31 | * @ingroup ClassicAttributes |
---|
32 | * |
---|
33 | * @{ |
---|
34 | */ |
---|
35 | |
---|
36 | /****************** Forced Attributes in Configuration ****************/ |
---|
37 | |
---|
38 | /** |
---|
39 | * This attribute constant indicates the attributes that are not |
---|
40 | * supportable given the hardware configuration. |
---|
41 | */ |
---|
42 | #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) |
---|
43 | #define ATTRIBUTES_NOT_SUPPORTED 0 |
---|
44 | #else |
---|
45 | #define ATTRIBUTES_NOT_SUPPORTED RTEMS_FLOATING_POINT |
---|
46 | #endif |
---|
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 | */ |
---|
64 | RTEMS_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 | */ |
---|
79 | RTEMS_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 | */ |
---|
94 | RTEMS_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 | */ |
---|
109 | RTEMS_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 | */ |
---|
123 | RTEMS_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 | */ |
---|
137 | RTEMS_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 | */ |
---|
151 | RTEMS_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 | */ |
---|
166 | RTEMS_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 | */ |
---|
180 | RTEMS_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 Checks if the priority ceiling attribute |
---|
189 | * is enabled in the attribute_set |
---|
190 | * |
---|
191 | * This function returns TRUE if the priority ceiling attribute |
---|
192 | * is enabled in the attribute_set and FALSE otherwise. |
---|
193 | */ |
---|
194 | RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority_ceiling( |
---|
195 | rtems_attribute attribute_set |
---|
196 | ) |
---|
197 | { |
---|
198 | return ( attribute_set & RTEMS_PRIORITY_CEILING ) ? true : false; |
---|
199 | } |
---|
200 | |
---|
201 | /** |
---|
202 | * @brief Checks if the barrier automatic release |
---|
203 | * attribute is enabled in the attribute_set |
---|
204 | * |
---|
205 | * This function returns TRUE if the barrier automatic release |
---|
206 | * attribute is enabled in the attribute_set and FALSE otherwise. |
---|
207 | */ |
---|
208 | RTEMS_INLINE_ROUTINE bool _Attributes_Is_barrier_automatic( |
---|
209 | rtems_attribute attribute_set |
---|
210 | ) |
---|
211 | { |
---|
212 | return ( attribute_set & RTEMS_BARRIER_AUTOMATIC_RELEASE ) ? true : false; |
---|
213 | } |
---|
214 | |
---|
215 | /** |
---|
216 | * @brief Checks if the system task attribute |
---|
217 | * is enabled in the attribute_set. |
---|
218 | * |
---|
219 | * This function returns TRUE if the system task attribute |
---|
220 | * is enabled in the attribute_set and FALSE otherwise. |
---|
221 | */ |
---|
222 | RTEMS_INLINE_ROUTINE bool _Attributes_Is_system_task( |
---|
223 | rtems_attribute attribute_set |
---|
224 | ) |
---|
225 | { |
---|
226 | return ( attribute_set & RTEMS_SYSTEM_TASK ) ? true : false; |
---|
227 | } |
---|
228 | |
---|
229 | /**@}*/ |
---|
230 | |
---|
231 | #ifdef __cplusplus |
---|
232 | } |
---|
233 | #endif |
---|
234 | |
---|
235 | #endif |
---|
236 | /* end of include file */ |
---|