1 | /** |
---|
2 | * @file rtems/rtems/attr.inl |
---|
3 | */ |
---|
4 | |
---|
5 | /* |
---|
6 | * This include file contains all of the inlined routines associated |
---|
7 | * with attributes. |
---|
8 | * |
---|
9 | * COPYRIGHT (c) 1989-1999. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.com/license/LICENSE. |
---|
15 | * |
---|
16 | * $Id$ |
---|
17 | */ |
---|
18 | |
---|
19 | #ifndef _RTEMS_RTEMS_ATTR_INL |
---|
20 | #define _RTEMS_RTEMS_ATTR_INL |
---|
21 | |
---|
22 | /*PAGE |
---|
23 | * |
---|
24 | * _Attributes_Set |
---|
25 | * |
---|
26 | * DESCRIPTION: |
---|
27 | * |
---|
28 | * This function sets the requested new_attributes in the attribute_set |
---|
29 | * passed in. The result is returned to the user. |
---|
30 | */ |
---|
31 | |
---|
32 | RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Set ( |
---|
33 | rtems_attribute new_attributes, |
---|
34 | rtems_attribute attribute_set |
---|
35 | ) |
---|
36 | { |
---|
37 | return attribute_set | new_attributes; |
---|
38 | } |
---|
39 | |
---|
40 | /*PAGE |
---|
41 | * |
---|
42 | * _Attributes_Clear |
---|
43 | * |
---|
44 | * DESCRIPTION: |
---|
45 | * |
---|
46 | * This function clears the requested new_attributes in the attribute_set |
---|
47 | * passed in. The result is returned to the user. |
---|
48 | */ |
---|
49 | |
---|
50 | RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Clear ( |
---|
51 | rtems_attribute attribute_set, |
---|
52 | rtems_attribute mask |
---|
53 | ) |
---|
54 | { |
---|
55 | return attribute_set & ~mask; |
---|
56 | } |
---|
57 | |
---|
58 | /*PAGE |
---|
59 | * |
---|
60 | * _Attributes_Is_floating_point |
---|
61 | * |
---|
62 | * DESCRIPTION: |
---|
63 | * |
---|
64 | * This function returns TRUE if the floating point attribute is |
---|
65 | * enabled in the attribute_set and FALSE otherwise. |
---|
66 | */ |
---|
67 | |
---|
68 | RTEMS_INLINE_ROUTINE boolean _Attributes_Is_floating_point( |
---|
69 | rtems_attribute attribute_set |
---|
70 | ) |
---|
71 | { |
---|
72 | return ( attribute_set & RTEMS_FLOATING_POINT ); |
---|
73 | } |
---|
74 | |
---|
75 | /*PAGE |
---|
76 | * |
---|
77 | * _Attributes_Is_global |
---|
78 | * |
---|
79 | * DESCRIPTION: |
---|
80 | * |
---|
81 | * This function returns TRUE if the global object attribute is |
---|
82 | * enabled in the attribute_set and FALSE otherwise. |
---|
83 | */ |
---|
84 | |
---|
85 | #if defined(RTEMS_MULTIPROCESSING) |
---|
86 | RTEMS_INLINE_ROUTINE boolean _Attributes_Is_global( |
---|
87 | rtems_attribute attribute_set |
---|
88 | ) |
---|
89 | { |
---|
90 | return ( attribute_set & RTEMS_GLOBAL ); |
---|
91 | } |
---|
92 | #endif |
---|
93 | |
---|
94 | /*PAGE |
---|
95 | * |
---|
96 | * _Attributes_Is_priority |
---|
97 | * |
---|
98 | * DESCRIPTION: |
---|
99 | * |
---|
100 | * This function returns TRUE if the priority attribute is |
---|
101 | * enabled in the attribute_set and FALSE otherwise. |
---|
102 | */ |
---|
103 | |
---|
104 | RTEMS_INLINE_ROUTINE boolean _Attributes_Is_priority( |
---|
105 | rtems_attribute attribute_set |
---|
106 | ) |
---|
107 | { |
---|
108 | return ( attribute_set & RTEMS_PRIORITY ); |
---|
109 | } |
---|
110 | |
---|
111 | /*PAGE |
---|
112 | * |
---|
113 | * _Attributes_Is_binary_semaphore |
---|
114 | * |
---|
115 | * DESCRIPTION: |
---|
116 | * |
---|
117 | * This function returns TRUE if the binary semaphore attribute is |
---|
118 | * enabled in the attribute_set and FALSE otherwise. |
---|
119 | */ |
---|
120 | |
---|
121 | RTEMS_INLINE_ROUTINE boolean _Attributes_Is_binary_semaphore( |
---|
122 | rtems_attribute attribute_set |
---|
123 | ) |
---|
124 | { |
---|
125 | return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_BINARY_SEMAPHORE); |
---|
126 | } |
---|
127 | |
---|
128 | /*PAGE |
---|
129 | * |
---|
130 | * _Attributes_Is_simple_binary_semaphore |
---|
131 | * |
---|
132 | * DESCRIPTION: |
---|
133 | * |
---|
134 | * This function returns TRUE if the simple binary semaphore attribute is |
---|
135 | * enabled in the attribute_set and FALSE otherwise. |
---|
136 | */ |
---|
137 | |
---|
138 | RTEMS_INLINE_ROUTINE boolean _Attributes_Is_simple_binary_semaphore( |
---|
139 | rtems_attribute attribute_set |
---|
140 | ) |
---|
141 | { |
---|
142 | return |
---|
143 | ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_SIMPLE_BINARY_SEMAPHORE); |
---|
144 | } |
---|
145 | |
---|
146 | /*PAGE |
---|
147 | * |
---|
148 | * _Attributes_Is_counting_semaphore |
---|
149 | * |
---|
150 | * DESCRIPTION: |
---|
151 | * |
---|
152 | * This function returns TRUE if the counting semaphore attribute is |
---|
153 | * enabled in the attribute_set and FALSE otherwise. |
---|
154 | */ |
---|
155 | |
---|
156 | RTEMS_INLINE_ROUTINE boolean _Attributes_Is_counting_semaphore( |
---|
157 | rtems_attribute attribute_set |
---|
158 | ) |
---|
159 | { |
---|
160 | return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_COUNTING_SEMAPHORE); |
---|
161 | } |
---|
162 | |
---|
163 | /*PAGE |
---|
164 | * |
---|
165 | * _Attributes_Is_inherit_priority |
---|
166 | * |
---|
167 | * DESCRIPTION: |
---|
168 | * |
---|
169 | * This function returns TRUE if the priority inheritance attribute |
---|
170 | * is enabled in the attribute_set and FALSE otherwise. |
---|
171 | */ |
---|
172 | |
---|
173 | RTEMS_INLINE_ROUTINE boolean _Attributes_Is_inherit_priority( |
---|
174 | rtems_attribute attribute_set |
---|
175 | ) |
---|
176 | { |
---|
177 | return ( attribute_set & RTEMS_INHERIT_PRIORITY ); |
---|
178 | } |
---|
179 | |
---|
180 | /*PAGE |
---|
181 | * |
---|
182 | * _Attributes_Is_priority_ceiling |
---|
183 | * |
---|
184 | * DESCRIPTION: |
---|
185 | * |
---|
186 | * This function returns TRUE if the priority ceiling attribute |
---|
187 | * is enabled in the attribute_set and FALSE otherwise. |
---|
188 | */ |
---|
189 | |
---|
190 | RTEMS_INLINE_ROUTINE boolean _Attributes_Is_priority_ceiling( |
---|
191 | rtems_attribute attribute_set |
---|
192 | ) |
---|
193 | { |
---|
194 | return ( attribute_set & RTEMS_PRIORITY_CEILING ); |
---|
195 | } |
---|
196 | |
---|
197 | /*PAGE |
---|
198 | * |
---|
199 | * _Attributes_Is_barrier_automatic |
---|
200 | * |
---|
201 | * DESCRIPTION: |
---|
202 | * |
---|
203 | * This function returns TRUE if the barrier automatic release |
---|
204 | * attribute is enabled in the attribute_set and FALSE otherwise. |
---|
205 | */ |
---|
206 | |
---|
207 | RTEMS_INLINE_ROUTINE boolean _Attributes_Is_barrier_automatic( |
---|
208 | rtems_attribute attribute_set |
---|
209 | ) |
---|
210 | { |
---|
211 | return ( attribute_set & RTEMS_BARRIER_AUTOMATIC_RELEASE ); |
---|
212 | } |
---|
213 | |
---|
214 | /*PAGE |
---|
215 | * |
---|
216 | * _Attributes_Is_system_task |
---|
217 | * |
---|
218 | * DESCRIPTION: |
---|
219 | * |
---|
220 | * This function returns TRUE if the system task attribute |
---|
221 | * is enabled in the attribute_set and FALSE otherwise. |
---|
222 | */ |
---|
223 | |
---|
224 | RTEMS_INLINE_ROUTINE boolean _Attributes_Is_system_task( |
---|
225 | rtems_attribute attribute_set |
---|
226 | ) |
---|
227 | { |
---|
228 | return ( attribute_set & RTEMS_SYSTEM_TASK ); |
---|
229 | } |
---|
230 | |
---|
231 | #endif |
---|
232 | /* end of include file */ |
---|