RTEMS 6.1-rc5
Loading...
Searching...
No Matches
attrimpl.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
12/*
13 * COPYRIGHT (c) 1989-2008.
14 * On-Line Applications Research Corporation (OAR).
15 *
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions
18 * are met:
19 * 1. Redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#ifndef _RTEMS_RTEMS_ATTR_INL
39#define _RTEMS_RTEMS_ATTR_INL
40
41#include <rtems/rtems/attr.h>
42#include <rtems/score/cpu.h>
43
44#ifdef __cplusplus
45extern "C" {
46#endif
47
59/****************** Forced Attributes in Configuration ****************/
60
65#define ATTRIBUTES_NOT_SUPPORTED 0
66
71#if ( CPU_ALL_TASKS_ARE_FP == TRUE )
72#define ATTRIBUTES_REQUIRED RTEMS_FLOATING_POINT
73#else
74#define ATTRIBUTES_REQUIRED 0
75#endif
76
83static inline rtems_attribute _Attributes_Set (
84 rtems_attribute new_attributes,
85 rtems_attribute attribute_set
86)
87{
88 return attribute_set | new_attributes;
89}
90
98static inline rtems_attribute _Attributes_Clear (
99 rtems_attribute attribute_set,
100 rtems_attribute mask
101)
102{
103 return attribute_set & ~mask;
104}
105
113static inline bool _Attributes_Is_floating_point(
114 rtems_attribute attribute_set
115)
116{
117 return ( attribute_set & RTEMS_FLOATING_POINT ) ? true : false;
118}
119
120#if defined(RTEMS_MULTIPROCESSING)
128static inline bool _Attributes_Is_global(
129 rtems_attribute attribute_set
130)
131{
132 return ( attribute_set & RTEMS_GLOBAL ) ? true : false;
133}
134#endif
135
142static inline bool _Attributes_Is_priority(
143 rtems_attribute attribute_set
144)
145{
146 return ( attribute_set & RTEMS_PRIORITY ) ? true : false;
147}
148
156static inline bool _Attributes_Is_binary_semaphore(
157 rtems_attribute attribute_set
158)
159{
160 return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_BINARY_SEMAPHORE);
161}
162
170static inline bool _Attributes_Is_simple_binary_semaphore(
171 rtems_attribute attribute_set
172)
173{
174 return
176}
177
185static inline bool _Attributes_Is_counting_semaphore(
186 rtems_attribute attribute_set
187)
188{
189 return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_COUNTING_SEMAPHORE);
190}
191
199static inline bool _Attributes_Is_inherit_priority(
200 rtems_attribute attribute_set
201)
202{
203 return ( attribute_set & RTEMS_INHERIT_PRIORITY ) ? true : false;
204}
205
213static inline bool _Attributes_Has_at_most_one_protocol(
214 rtems_attribute attribute_set
215)
216{
219
220 return ( attribute_set & ( attribute_set - 1 ) ) == 0;
221}
222
230static inline bool _Attributes_Is_priority_ceiling(
231 rtems_attribute attribute_set
232)
233{
234 return ( attribute_set & RTEMS_PRIORITY_CEILING ) ? true : false;
235}
236
244static inline bool _Attributes_Is_multiprocessor_resource_sharing(
245 rtems_attribute attribute_set
246)
247{
248 return ( attribute_set & RTEMS_MULTIPROCESSOR_RESOURCE_SHARING ) != 0;
249}
250
258static inline bool _Attributes_Is_barrier_automatic(
259 rtems_attribute attribute_set
260)
261{
262 return ( attribute_set & RTEMS_BARRIER_AUTOMATIC_RELEASE ) ? true : false;
263}
264
272static inline bool _Attributes_Is_system_task(
273 rtems_attribute attribute_set
274)
275{
276 return ( attribute_set & RTEMS_SYSTEM_TASK ) ? true : false;
277}
278
281#ifdef __cplusplus
282}
283#endif
284
285#endif
286/* end of include file */
This header file provides Classic API directive attributes.
#define RTEMS_COUNTING_SEMAPHORE
This attribute constant indicates that the Classic API semaphore created by rtems_semaphore_create() ...
Definition: attr.h:138
#define RTEMS_GLOBAL
This attribute constant indicates that the Classic API object shall be a global resource in a multipr...
Definition: attr.h:185
#define RTEMS_SEMAPHORE_CLASS
This attribute constant represents the mask of bits associated with the Classic API semaphore classes...
Definition: attr.h:309
#define RTEMS_INHERIT_PRIORITY
This attribute constant indicates that the Classic API semaphore created by rtems_semaphore_create() ...
Definition: attr.h:199
#define RTEMS_SYSTEM_TASK
This attribute constant indicates that the Classic API task created by rtems_task_create() or rtems_t...
Definition: attr.h:329
#define RTEMS_BINARY_SEMAPHORE
This attribute constant indicates that the Classic API semaphore created by rtems_semaphore_create() ...
Definition: attr.h:128
#define RTEMS_MULTIPROCESSOR_RESOURCE_SHARING
This attribute constant indicates that the Classic API semaphore created by rtems_semaphore_create() ...
Definition: attr.h:226
#define RTEMS_PRIORITY
This attribute constant indicates that the Classic API object shall manage blocking tasks using the t...
Definition: attr.h:284
#define RTEMS_PRIORITY_CEILING
This attribute constant indicates that the Classic API semaphore created by rtems_semaphore_create() ...
Definition: attr.h:298
#define RTEMS_SIMPLE_BINARY_SEMAPHORE
This attribute constant indicates that the Classic API semaphore created by rtems_semaphore_create() ...
Definition: attr.h:319
#define RTEMS_FLOATING_POINT
This attribute constant indicates that the Classic API task created by rtems_task_create() or rtems_t...
Definition: attr.h:172
#define RTEMS_BARRIER_AUTOMATIC_RELEASE
This attribute constant indicates that the Classic API barrier created by rtems_barrier_create() shal...
Definition: attr.h:107
uint32_t rtems_attribute
This type represents Classic API attributes.
Definition: attr.h:96