RTEMS  5.0.0
config.h
Go to the documentation of this file.
1 
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 /*
23  * Unlimited object support. Changes the configuration table entry for POSIX
24  * or RTEMS APIs to bounded only by the memory of the work-space.
25  *
26  * Use the macro to define the resource unlimited before placing in
27  * the configuration table.
28  */
29 
30 #include <rtems/score/object.h>
31 #include <rtems/score/isr.h>
33 #include <rtems/rtems/config.h>
34 #include <rtems/posix/config.h>
35 #include <rtems/extension.h>
36 #if defined(RTEMS_MULTIPROCESSING)
37 #include <rtems/score/mpci.h>
38 #endif
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 #define RTEMS_UNLIMITED_OBJECTS OBJECTS_UNLIMITED_OBJECTS
45 
46 #define rtems_resource_unlimited(resource) \
47  ( resource | RTEMS_UNLIMITED_OBJECTS )
48 
49 #define rtems_resource_is_unlimited(resource) \
50  _Objects_Is_unlimited(resource)
51 
52 #define rtems_resource_maximum_per_allocation(resource) \
53  _Objects_Maximum_per_allocation(resource)
54 
55 #if defined(RTEMS_MULTIPROCESSING)
56 /*
57  * The following records define the Multiprocessor Configuration
58  * Table. This table defines the multiprocessor system
59  * characteristics which must be known by RTEMS in a multiprocessor
60  * system.
61  */
62 typedef struct {
64  uint32_t node;
66  uint32_t maximum_nodes;
68  uint32_t maximum_global_objects;
70  uint32_t maximum_proxies;
71 
77  uint32_t extra_mpci_receive_server_stack;
78 
80  rtems_mpci_table *User_mpci_table;
81 } rtems_multiprocessing_table;
82 #endif
83 
89 typedef void (*rtems_stack_allocate_init_hook)( size_t stack_space_size );
90 
99 typedef void *(*rtems_stack_allocate_hook)( size_t stack_size );
100 
106 typedef void (*rtems_stack_free_hook)( void *addr );
107 
108 /*
109  * The following records define the Configuration Table. The
110  * information contained in this table is required in all
111  * RTEMS systems, whether single or multiprocessor. This
112  * table primarily defines the following:
113  *
114  * + location and size of the RTEMS Workspace
115  * + microseconds per clock tick
116  * + clock ticks per task timeslice
117  * + required number of each object type for each API configured
118  */
119 typedef struct {
123  uintptr_t work_space_size;
124 
128  uintptr_t stack_space_size;
129 
139 
145 
150 
155  void *(*idle_task)( uintptr_t );
156 
163 
168 
173 
178 
186 
194 
203 
204  #ifdef RTEMS_SMP
205  bool smp_enabled;
206  #endif
207 
208  uint32_t number_of_initial_extensions;
209  const rtems_extensions_table *User_extension_table;
210  #if defined(RTEMS_MULTIPROCESSING)
211  rtems_multiprocessing_table *User_multiprocessing_table;
212  #endif
213  #ifdef RTEMS_SMP
214  uint32_t maximum_processors;
215  #endif
217 
222 
223 #if defined(RTEMS_MULTIPROCESSING)
224 
227  extern rtems_multiprocessing_table *_Configuration_MP_table;
228 #endif
229 
230 #if defined(RTEMS_MULTIPROCESSING)
231 
237  extern rtems_multiprocessing_table Multiprocessing_configuration;
238 
239  /*
240  * This is the default Multiprocessing Configuration Table.
241  * It is used in single processor configurations.
242  */
243  extern const rtems_multiprocessing_table
244  _Initialization_Default_multiprocessing_table;
245 #endif
246 
247 
248 /*
249  * Some handy macros to avoid dependencies on either the BSP
250  * or the exact format of the configuration table.
251  */
252 
253 #define rtems_configuration_get_unified_work_area() \
254  (Configuration.unified_work_area)
255 
256 #define rtems_configuration_get_stack_allocator_avoids_work_space() \
257  (Configuration.stack_allocator_avoids_work_space)
258 
259 #define rtems_configuration_get_stack_space_size() \
260  (Configuration.stack_space_size)
261 
262 #define rtems_configuration_get_work_space_size() \
263  (Configuration.work_space_size + \
264  (rtems_configuration_get_stack_allocator_avoids_work_space() ? \
265  0 : rtems_configuration_get_stack_space_size()))
266 
267 uint32_t rtems_configuration_get_maximum_extensions( void );
268 
269 #define rtems_configuration_get_microseconds_per_tick() \
270  (Configuration.microseconds_per_tick)
271 #define rtems_configuration_get_milliseconds_per_tick() \
272  (Configuration.microseconds_per_tick / 1000)
273 #define rtems_configuration_get_nanoseconds_per_tick() \
274  (_Watchdog_Nanoseconds_per_tick)
275 
276 #define rtems_configuration_get_ticks_per_timeslice() \
277  (Configuration.ticks_per_timeslice)
278 
279 #define rtems_configuration_get_idle_task() \
280  (Configuration.idle_task)
281 
282 #define rtems_configuration_get_idle_task_stack_size() \
283  (Configuration.idle_task_stack_size)
284 
285 #define rtems_configuration_get_interrupt_stack_size() \
286  ((size_t) _ISR_Stack_size)
287 
288 #define rtems_configuration_get_stack_allocate_init_hook() \
289  (Configuration.stack_allocate_init_hook)
290 
291 #define rtems_configuration_get_stack_allocate_hook() \
292  (Configuration.stack_allocate_hook)
293 
294 #define rtems_configuration_get_stack_free_hook() \
295  (Configuration.stack_free_hook)
296 
301 #define rtems_configuration_get_do_zero_of_workspace() \
302  (Configuration.do_zero_of_workspace)
303 
304 #define rtems_configuration_get_number_of_initial_extensions() \
305  (Configuration.number_of_initial_extensions)
306 
307 #define rtems_configuration_get_user_extension_table() \
308  (Configuration.User_extension_table)
309 
310 #if defined(RTEMS_MULTIPROCESSING)
311  #define rtems_configuration_get_user_multiprocessing_table() \
312  (Configuration.User_multiprocessing_table)
313 #else
314  #define rtems_configuration_get_user_multiprocessing_table() \
315  NULL
316 #endif
317 
328 #ifdef RTEMS_SMP
329  #define rtems_configuration_is_smp_enabled() \
330  (Configuration.smp_enabled)
331 #else
332  #define rtems_configuration_is_smp_enabled() \
333  false
334 #endif
335 
347 #ifdef RTEMS_SMP
348  #define rtems_configuration_get_maximum_processors() \
349  (Configuration.maximum_processors)
350 #else
351  #define rtems_configuration_get_maximum_processors() \
352  1
353 #endif
354 
355 #define rtems_configuration_get_rtems_api_configuration() \
356  (&Configuration_RTEMS_API)
357 
358 #define rtems_configuration_get_posix_api_configuration() \
359  (&Configuration_POSIX_API)
360 
361 #ifdef __cplusplus
362 }
363 #endif
364 
365 #endif
366 /* end of include file */
uintptr_t stack_space_size
Definition: config.h:128
uint32_t microseconds_per_tick
Definition: config.h:144
void *(* rtems_stack_allocate_hook)(size_t stack_size)
Task stack allocator hook.
Definition: config.h:99
bool stack_allocator_avoids_work_space
Specifies if the stack allocator avoids the work space.
Definition: config.h:202
rtems_stack_allocate_hook stack_allocate_hook
Optional task stack allocator hook.
Definition: config.h:172
uintptr_t work_space_size
Definition: config.h:123
Data Related to the Management of Processor Interrupt Levels.
bool unified_work_area
Specifies if a unified work area is used or not.
Definition: config.h:193
Constants and Structures Associated with the Object Handler.
User Defined Configuration Parameters Specific For The POSIX API.
Definition: config.h:119
void(* rtems_stack_free_hook)(void *addr)
Task stack deallocator hook.
Definition: config.h:106
bool do_zero_of_workspace
Definition: config.h:185
void(* rtems_stack_allocate_init_hook)(size_t stack_space_size)
Task stack allocator initialization hook.
Definition: config.h:89
MPCI Layer API.
uint32_t idle_task_stack_size
Definition: config.h:162
User Extensions API.
uint32_t ticks_per_timeslice
Definition: config.h:149
rtems_stack_free_hook stack_free_hook
Optional task stack free hook.
Definition: config.h:177
const rtems_configuration_table Configuration
User extension table.
Definition: userext.h:232
uint32_t maximum_key_value_pairs
Definition: config.h:138
rtems_stack_allocate_init_hook stack_allocate_init_hook
Optional task stack allocator initialization hook.
Definition: config.h:167