source: rtems/cpukit/include/rtems/config.h @ 2afb22b

Last change on this file since 2afb22b was 2afb22b, checked in by Chris Johns <chrisj@…>, on Dec 23, 2017 at 7:18:56 AM

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: 11.6 KB
Line 
1/**
2 * @file
3 *
4 * @brief Table of User Defined Configuration Parameters
5 *
6 * This include file contains the table of user defined configuration
7 * parameters.
8 */
9
10/*
11 *  COPYRIGHT (c) 1989-2014.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#ifndef _RTEMS_CONFIG_H
20#define _RTEMS_CONFIG_H
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26/*
27 *  Unlimited object support. Changes the configuration table entry for POSIX
28 *  or RTEMS APIs to bounded only by the memory of the work-space.
29 *
30 *  Use the macro to define the resource unlimited before placing in
31 *  the configuration table.
32 */
33
34#include <rtems/score/object.h>
35#define RTEMS_UNLIMITED_OBJECTS OBJECTS_UNLIMITED_OBJECTS
36
37#define rtems_resource_unlimited(resource) \
38  ( resource | RTEMS_UNLIMITED_OBJECTS )
39
40#define rtems_resource_is_unlimited(resource) \
41  _Objects_Is_unlimited(resource)
42
43#define rtems_resource_maximum_per_allocation(resource) \
44  _Objects_Maximum_per_allocation(resource)
45
46#include <rtems/score/watchdog.h>
47
48/*
49 *  This is kind of kludgy but it allows targets to totally ignore the
50 *  optional APIs like POSIX safely.
51 */
52
53#ifdef RTEMS_POSIX_API
54#include <rtems/posix/config.h>
55#else
56typedef void *posix_api_configuration_table;
57#endif
58
59#include <rtems/rtems/config.h>
60
61#include <rtems/extension.h>
62#if defined(RTEMS_MULTIPROCESSING)
63#include <rtems/score/mpci.h>
64#endif
65
66#if defined(RTEMS_MULTIPROCESSING)
67/*
68 *  The following records define the Multiprocessor Configuration
69 *  Table.  This table defines the multiprocessor system
70 *  characteristics which must be known by RTEMS in a multiprocessor
71 *  system.
72 */
73typedef struct {
74  /** This is the local node number. */
75  uint32_t            node;
76  /** This is the maximum number of nodes in system. */
77  uint32_t            maximum_nodes;
78  /** This is the maximum number of global objects. */
79  uint32_t            maximum_global_objects;
80  /** This is the maximum number of proxies. */
81  uint32_t            maximum_proxies;
82
83  /**
84   * The MPCI Receive server is assumed to have a stack of at least
85   * minimum stack size.  This field specifies the amount of extra
86   * stack this task will be given in bytes.
87   */
88  uint32_t            extra_mpci_receive_server_stack;
89
90  /** This is a pointer to User/BSP provided MPCI Table. */
91  rtems_mpci_table   *User_mpci_table;
92} rtems_multiprocessing_table;
93#endif
94
95/**
96 * @brief Task stack allocator initialization hook.
97 *
98 * @param[in] stack_space_size is the size of the stack space in bytes.
99 */
100typedef void (*rtems_stack_allocate_init_hook)( size_t stack_space_size );
101
102/**
103 * @brief Task stack allocator hook.
104 *
105 * @param[in] stack_size is the Size of the task stack in bytes.
106 *
107 * @retval NULL Not enough memory.
108 * @retval other Pointer to task stack.
109 */
110typedef void *(*rtems_stack_allocate_hook)( size_t stack_size );
111
112/**
113 * @brief Task stack deallocator hook.
114 *
115 * @param[in] addr is a pointer to previously allocated task stack.
116 */
117typedef void (*rtems_stack_free_hook)( void *addr );
118
119/*
120 *  The following records define the Configuration Table.  The
121 *  information contained in this table is required in all
122 *  RTEMS systems, whether single or multiprocessor.  This
123 *  table primarily defines the following:
124 *
125 *     + location and size of the RTEMS Workspace
126 *     + microseconds per clock tick
127 *     + clock ticks per task timeslice
128 *     + required number of each object type for each API configured
129 */
130typedef struct {
131  /**
132   * This field specifies the size in bytes of the RTEMS Workspace.
133   */
134  uintptr_t                      work_space_size;
135
136  /**
137   * This field specifies the size in bytes of the RTEMS thread stack space.
138   */
139  uintptr_t                      stack_space_size;
140
141  /**
142   * This field specifies the maximum number of dynamically installed
143   * used extensions.
144   */
145  uint32_t                       maximum_extensions;
146
147  /**
148   * This field contains the maximum number of POSIX API
149   * keys which are configured for this application.
150   */
151  uint32_t                       maximum_keys;
152
153  /**
154   * This field contains the maximum number of POSIX API
155   * key value pairs which are configured for this application.
156   *
157   * @note There can be potentially be a key/value pair for
158   *       every thread to use every key. But normally this
159   *       many are not needed in a system.
160   */
161  uint32_t                            maximum_key_value_pairs;
162
163  /**
164   * This field specifies the number of microseconds which elapse
165   * between clock ticks.  This is the basis for RTEMS timing.
166   */
167  uint32_t                       microseconds_per_tick;
168
169  /**
170   * This field specifies the number of ticks in each task's timeslice.
171   */
172  uint32_t                       ticks_per_timeslice;
173
174  /**
175   * This element points to the BSP's optional idle task which may override
176   * the default one provided with RTEMS.
177   */
178  void                        *(*idle_task)( uintptr_t );
179
180  /**
181   * This field specifies the size of the IDLE task's stack.  If less than or
182   * equal to the minimum stack size, then the IDLE task will have the minimum
183   * stack size.
184   */
185  uint32_t                       idle_task_stack_size;
186
187  /**
188   * This field specifies the size of the interrupt stack.  If less than or
189   * equal to the minimum stack size, then the interrupt stack will be of
190   * minimum stack size.
191   */
192  uint32_t                       interrupt_stack_size;
193
194  /**
195   * @brief Optional task stack allocator initialization hook.
196   */
197  rtems_stack_allocate_init_hook stack_allocate_init_hook;
198
199  /**
200   * @brief Optional task stack allocator hook.
201   */
202  rtems_stack_allocate_hook      stack_allocate_hook;
203
204  /**
205   * @brief Optional task stack free hook.
206   */
207  rtems_stack_free_hook          stack_free_hook;
208
209  /**
210   * If this element is TRUE, then RTEMS will zero the Executive Workspace.
211   * When this element is FALSE, it is assumed that the BSP or invoking
212   * environment has ensured that memory was cleared before RTEMS was
213   * invoked.
214   */
215  bool                           do_zero_of_workspace;
216
217  /**
218   * @brief Specifies if a unified work area is used or not.
219   *
220   * If this element is @a true, then the RTEMS Workspace and the C Program
221   * Heap use the same heap, otherwise they use separate heaps.
222   */
223  bool                           unified_work_area;
224
225  /**
226   * @brief Specifies if the stack allocator avoids the work space.
227   *
228   * If this element is @a true, then the stack allocator must not allocate the
229   * thread stacks from the RTEMS Workspace, otherwise it should allocate the
230   * thread stacks from the RTEMS Workspace.
231   */
232  bool                           stack_allocator_avoids_work_space;
233
234  #ifdef RTEMS_SMP
235    bool                         smp_enabled;
236  #endif
237
238  uint32_t                       number_of_initial_extensions;
239  const rtems_extensions_table  *User_extension_table;
240  #if defined(RTEMS_MULTIPROCESSING)
241    rtems_multiprocessing_table   *User_multiprocessing_table;
242  #endif
243  #ifdef RTEMS_SMP
244    uint32_t                     maximum_processors;
245  #endif
246} rtems_configuration_table;
247
248/**
249 * This is the configuration table generated by confdefs.h.
250 */
251extern const rtems_configuration_table Configuration;
252
253#if defined(RTEMS_MULTIPROCESSING)
254  /**
255   *  This points to the multiprocessing configuration table.
256   */
257  extern rtems_multiprocessing_table *_Configuration_MP_table;
258#endif
259
260#if defined(RTEMS_MULTIPROCESSING)
261  /**
262   * @brief RTEMS multiprocessing configuration table.
263   *
264   * This is the RTEMS Multiprocessing Configuration Table expected to
265   * be generated by confdefs.h.
266   */
267  extern rtems_multiprocessing_table Multiprocessing_configuration;
268
269  /*
270   *  This is the default Multiprocessing Configuration Table.
271   *  It is used in single processor configurations.
272   */
273  extern const rtems_multiprocessing_table
274    _Initialization_Default_multiprocessing_table;
275#endif
276
277
278/*
279 *  Some handy macros to avoid dependencies on either the BSP
280 *  or the exact format of the configuration table.
281 */
282
283#define rtems_configuration_get_unified_work_area() \
284        (Configuration.unified_work_area)
285
286#define rtems_configuration_get_stack_allocator_avoids_work_space() \
287        (Configuration.stack_allocator_avoids_work_space)
288
289#define rtems_configuration_get_stack_space_size() \
290        (Configuration.stack_space_size)
291
292#define rtems_configuration_get_work_space_size() \
293        (Configuration.work_space_size + \
294          (rtems_configuration_get_stack_allocator_avoids_work_space() ? \
295            0 : rtems_configuration_get_stack_space_size()))
296
297#define rtems_configuration_get_maximum_extensions() \
298        (Configuration.maximum_extensions)
299
300#define rtems_configuration_get_microseconds_per_tick() \
301        (Configuration.microseconds_per_tick)
302#define rtems_configuration_get_milliseconds_per_tick() \
303        (Configuration.microseconds_per_tick / 1000)
304#define rtems_configuration_get_nanoseconds_per_tick() \
305        (_Watchdog_Nanoseconds_per_tick)
306
307#define rtems_configuration_get_ticks_per_timeslice() \
308        (Configuration.ticks_per_timeslice)
309
310#define rtems_configuration_get_idle_task() \
311        (Configuration.idle_task)
312
313#define rtems_configuration_get_idle_task_stack_size() \
314        (Configuration.idle_task_stack_size)
315
316#define rtems_configuration_get_interrupt_stack_size() \
317        (Configuration.interrupt_stack_size)
318
319#define rtems_configuration_get_stack_allocate_init_hook() \
320        (Configuration.stack_allocate_init_hook)
321
322#define rtems_configuration_get_stack_allocate_hook() \
323        (Configuration.stack_allocate_hook)
324
325#define rtems_configuration_get_stack_free_hook() \
326        (Configuration.stack_free_hook)
327
328 /**
329  * This macro assists in accessing the field which indicates whether
330  * RTEMS is responsible for zeroing the Executive Workspace.
331  */
332#define rtems_configuration_get_do_zero_of_workspace() \
333   (Configuration.do_zero_of_workspace)
334
335#define rtems_configuration_get_number_of_initial_extensions() \
336        (Configuration.number_of_initial_extensions)
337
338#define rtems_configuration_get_user_extension_table() \
339        (Configuration.User_extension_table)
340
341#if defined(RTEMS_MULTIPROCESSING)
342  #define rtems_configuration_get_user_multiprocessing_table() \
343        (Configuration.User_multiprocessing_table)
344#else
345  #define rtems_configuration_get_user_multiprocessing_table() \
346        NULL
347#endif
348
349/**
350 * @brief Returns true if the SMP mode of operation is enabled, and false
351 * otherwise.
352 *
353 * In uni-processor configurations this is a compile-time constant which
354 * evaluates to false.
355 *
356 * @retval true SMP mode of operation is enabled.
357 * @retval false Otherwise.
358 */
359#ifdef RTEMS_SMP
360  #define rtems_configuration_is_smp_enabled() \
361        (Configuration.smp_enabled)
362#else
363  #define rtems_configuration_is_smp_enabled() \
364        false
365#endif
366
367/**
368 * @brief Returns the configured maximum count of processors.
369 *
370 * The actual number of processors available for the application will be less
371 * than or equal to the configured maximum count of processors.
372 *
373 * On single-processor configurations this is a compile time constant which
374 * evaluates to one.
375 *
376 * @return The configured maximum count of processors.
377 */
378#ifdef RTEMS_SMP
379  #define rtems_configuration_get_maximum_processors() \
380        (Configuration.maximum_processors)
381#else
382  #define rtems_configuration_get_maximum_processors() \
383        1
384#endif
385
386#define rtems_configuration_get_rtems_api_configuration() \
387        (&Configuration_RTEMS_API)
388
389#define rtems_configuration_get_posix_api_configuration() \
390        (&Configuration_POSIX_API)
391
392#ifdef __cplusplus
393}
394#endif
395
396#endif
397/* end of include file */
Note: See TracBrowser for help on using the repository browser.