source: rtems/cpukit/include/rtems/rtems/attrimpl.h @ 21275b58

5
Last change on this file since 21275b58 was 2afb22b, checked in by Chris Johns <chrisj@…>, on 12/23/17 at 07:18:56

Remove make preinstall

A speciality of the RTEMS build system was the make preinstall step. It
copied header files from arbitrary locations into the build tree. The
header files were included via the -Bsome/build/tree/path GCC command
line option.

This has at least seven problems:

  • The make preinstall step itself needs time and disk space.
  • Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error.
  • There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult.
  • The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit.
  • An introduction of a new build system is difficult.
  • Include paths specified by the -B option are system headers. This may suppress warnings.
  • The parallel build had sporadic failures on some hosts.

This patch removes the make preinstall step. All installed header
files are moved to dedicated include directories in the source tree.
Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc,
etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g.
erc32, imx, qoriq, etc.

The new cpukit include directories are:

  • cpukit/include
  • cpukit/score/cpu/@RTEMS_CPU@/include
  • cpukit/libnetworking

The new BSP include directories are:

  • bsps/include
  • bsps/@RTEMS_CPU@/include
  • bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include

There are build tree include directories for generated files.

The include directory order favours the most general header file, e.g.
it is not possible to override general header files via the include path
order.

The "bootstrap -p" option was removed. The new "bootstrap -H" option
should be used to regenerate the "headers.am" files.

Update #3254.

  • Property mode set to 100644
File size: 6.7 KB
Line 
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
25extern "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#define ATTRIBUTES_NOT_SUPPORTED       0
43
44/**
45 *  This attribute constant indicates the attributes that are
46 *  required given the hardware configuration.
47 */
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
54/**
55 *  @brief Sets the requested new_attributes in the attribute_set passed in.
56 *
57 *  This function sets the requested new_attributes in the attribute_set
58 *  passed in.  The result is returned to the user.
59 */
60RTEMS_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
68/**
69 *  @brief Clears the requested new_attributes in the attribute_set
70 *  passed in.
71 *
72 *  This function clears the requested new_attributes in the attribute_set
73 *  passed in.  The result is returned to the user.
74 */
75RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Clear (
76   rtems_attribute attribute_set,
77   rtems_attribute mask
78)
79{
80  return attribute_set & ~mask;
81}
82
83/**
84 *  @brief Checks if the floating point attribute is
85 *  enabled in the attribute_set.
86 *
87 *  This function returns TRUE if the floating point attribute is
88 *  enabled in the attribute_set and FALSE otherwise.
89 */
90RTEMS_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)
98/**
99 *  @brief Checks if the global object attribute is enabled in
100 *  the attribute_set.
101 *
102 *  This function returns TRUE if the global object attribute is
103 *  enabled in the attribute_set and FALSE otherwise.
104 */
105RTEMS_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
113/**
114 *  @brief Checks if the priority attribute is enabled in the attribute_set.
115 *
116 *  This function returns TRUE if the priority attribute is
117 *  enabled in the attribute_set and FALSE otherwise.
118 */
119RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority(
120  rtems_attribute attribute_set
121)
122{
123   return ( attribute_set & RTEMS_PRIORITY ) ? true : false;
124}
125
126/**
127 *  @brief Checks if the binary semaphore attribute is
128 *  enabled in the attribute_set.
129 *
130 *  This function returns TRUE if the binary semaphore attribute is
131 *  enabled in the attribute_set and FALSE otherwise.
132 */
133RTEMS_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
140/**
141 *  @brief Checks if the simple binary semaphore attribute is
142 *  enabled in the attribute_set
143 *
144 *  This function returns TRUE if the simple binary semaphore attribute is
145 *  enabled in the attribute_set and FALSE otherwise.
146 */
147RTEMS_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
155/**
156 *  @brief Checks if the counting semaphore attribute is
157 *  enabled in the attribute_set
158 *
159 *  This function returns TRUE if the counting semaphore attribute is
160 *  enabled in the attribute_set and FALSE otherwise.
161 */
162RTEMS_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
169/**
170 *  @brief Checks if the priority inheritance attribute
171 *  is enabled in the attribute_set
172 *
173 *  This function returns TRUE if the priority inheritance attribute
174 *  is enabled in the attribute_set and FALSE otherwise.
175 */
176RTEMS_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
183/**
184 * @brief Returns true if the attribute set has at most one protocol, and false
185 * otherwise.
186 *
187 * The protocols are RTEMS_INHERIT_PRIORITY, RTEMS_PRIORITY_CEILING and
188 * RTEMS_MULTIPROCESSOR_RESOURCE_SHARING.
189 */
190RTEMS_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
200/**
201 *  @brief Checks if the priority ceiling attribute
202 *  is enabled in the attribute_set
203 *
204 *  This function returns TRUE if the priority ceiling attribute
205 *  is enabled in the attribute_set and FALSE otherwise.
206 */
207RTEMS_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
214/**
215 *  @brief Checks if the Multiprocessor Resource Sharing Protocol attribute
216 *  is enabled in the attribute_set
217 *
218 *  This function returns TRUE if the Multiprocessor Resource Sharing Protocol
219 *  attribute is enabled in the attribute_set and FALSE otherwise.
220 */
221RTEMS_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
228/**
229 *  @brief Checks if the barrier automatic release
230 *  attribute is enabled in the attribute_set
231 *
232 *  This function returns TRUE if the barrier automatic release
233 *  attribute is enabled in the attribute_set and FALSE otherwise.
234 */
235RTEMS_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
242/**
243 *  @brief Checks if the system task attribute
244 *  is enabled in the attribute_set.
245 *
246 *  This function returns TRUE if the system task attribute
247 *  is enabled in the attribute_set and FALSE otherwise.
248 */
249RTEMS_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
256/**@}*/
257
258#ifdef __cplusplus
259}
260#endif
261
262#endif
263/* end of include file */
Note: See TracBrowser for help on using the repository browser.