RTEMS CPU Kit with SuperCore  4.11.3
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 #ifdef __cplusplus
23 extern "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 /*
47  * This is kind of kludgy but it allows targets to totally ignore the
48  * optional APIs like POSIX safely.
49  */
50 
51 #ifdef RTEMS_POSIX_API
52 #include <rtems/posix/config.h>
53 #else
54 typedef void *posix_api_configuration_table;
55 #endif
56 
57 #include <rtems/rtems/config.h>
58 
59 #include <rtems/extension.h>
60 #if defined(RTEMS_MULTIPROCESSING)
61 #include <rtems/score/mpci.h>
62 #endif
63 
64 #if defined(RTEMS_MULTIPROCESSING)
65 /*
66  * The following records define the Multiprocessor Configuration
67  * Table. This table defines the multiprocessor system
68  * characteristics which must be known by RTEMS in a multiprocessor
69  * system.
70  */
71 typedef struct {
73  uint32_t node;
75  uint32_t maximum_nodes;
77  uint32_t maximum_global_objects;
79  uint32_t maximum_proxies;
80 
86  uint32_t extra_mpci_receive_server_stack;
87 
89  rtems_mpci_table *User_mpci_table;
90 } rtems_multiprocessing_table;
91 #endif
92 
98 typedef void (*rtems_stack_allocate_init_hook)( size_t stack_space_size );
99 
108 typedef void *(*rtems_stack_allocate_hook)( size_t stack_size );
109 
115 typedef void (*rtems_stack_free_hook)( void *addr );
116 
117 /*
118  * The following records define the Configuration Table. The
119  * information contained in this table is required in all
120  * RTEMS systems, whether single or multiprocessor. This
121  * table primarily defines the following:
122  *
123  * + location and size of the RTEMS Workspace
124  * + microseconds per clock tick
125  * + clock ticks per task timeslice
126  * + required number of each object type for each API configured
127  */
128 typedef struct {
132  uintptr_t work_space_size;
133 
137  uintptr_t stack_space_size;
138 
144 
149  uint32_t maximum_keys;
150 
160 
166 
174 
179 
184  Thread (*idle_task)( uintptr_t );
185 
192 
199 
204 
209 
214 
222 
230 
239 
240  #ifdef RTEMS_SMP
241  bool smp_enabled;
242  #endif
243 
244  uint32_t number_of_initial_extensions;
245  const rtems_extensions_table *User_extension_table;
246  #if defined(RTEMS_MULTIPROCESSING)
247  rtems_multiprocessing_table *User_multiprocessing_table;
248  #endif
249  #ifdef RTEMS_SMP
250  uint32_t maximum_processors;
251  #endif
253 
258 
259 #if defined(RTEMS_MULTIPROCESSING)
260 
263  SAPI_EXTERN rtems_multiprocessing_table *_Configuration_MP_table;
264 #endif
265 
266 #if defined(RTEMS_MULTIPROCESSING)
267 
273  extern rtems_multiprocessing_table Multiprocessing_configuration;
274 #endif
275 
276 
277 /*
278  * Some handy macros to avoid dependencies on either the BSP
279  * or the exact format of the configuration table.
280  */
281 
282 #define rtems_configuration_get_unified_work_area() \
283  (Configuration.unified_work_area)
284 
285 #define rtems_configuration_get_stack_allocator_avoids_work_space() \
286  (Configuration.stack_allocator_avoids_work_space)
287 
288 #define rtems_configuration_get_stack_space_size() \
289  (Configuration.stack_space_size)
290 
291 #define rtems_configuration_get_work_space_size() \
292  (Configuration.work_space_size + \
293  (rtems_configuration_get_stack_allocator_avoids_work_space() ? \
294  0 : rtems_configuration_get_stack_space_size()))
295 
296 #define rtems_configuration_get_maximum_extensions() \
297  (Configuration.maximum_extensions)
298 
299 #define rtems_configuration_get_microseconds_per_tick() \
300  (Configuration.microseconds_per_tick)
301 #define rtems_configuration_get_milliseconds_per_tick() \
302  (Configuration.microseconds_per_tick / 1000)
303 #define rtems_configuration_get_nanoseconds_per_tick() \
304  (Configuration.nanoseconds_per_tick)
305 
306 #define rtems_configuration_get_ticks_per_timeslice() \
307  (Configuration.ticks_per_timeslice)
308 
309 #define rtems_configuration_get_idle_task() \
310  (Configuration.idle_task)
311 
312 #define rtems_configuration_get_idle_task_stack_size() \
313  (Configuration.idle_task_stack_size)
314 
315 #define rtems_configuration_get_interrupt_stack_size() \
316  (Configuration.interrupt_stack_size)
317 
318 #define rtems_configuration_get_stack_allocate_init_hook() \
319  (Configuration.stack_allocate_init_hook)
320 
321 #define rtems_configuration_get_stack_allocate_hook() \
322  (Configuration.stack_allocate_hook)
323 
324 #define rtems_configuration_get_stack_free_hook() \
325  (Configuration.stack_free_hook)
326 
331 #define rtems_configuration_get_do_zero_of_workspace() \
332  (Configuration.do_zero_of_workspace)
333 
334 #define rtems_configuration_get_number_of_initial_extensions() \
335  (Configuration.number_of_initial_extensions)
336 
337 #define rtems_configuration_get_user_extension_table() \
338  (Configuration.User_extension_table)
339 
340 #if defined(RTEMS_MULTIPROCESSING)
341  #define rtems_configuration_get_user_multiprocessing_table() \
342  (Configuration.User_multiprocessing_table)
343 #else
344  #define rtems_configuration_get_user_multiprocessing_table() \
345  NULL
346 #endif
347 
358 #ifdef RTEMS_SMP
359  #define rtems_configuration_is_smp_enabled() \
360  (Configuration.smp_enabled)
361 #else
362  #define rtems_configuration_is_smp_enabled() \
363  false
364 #endif
365 
377 #ifdef RTEMS_SMP
378  #define rtems_configuration_get_maximum_processors() \
379  (Configuration.maximum_processors)
380 #else
381  #define rtems_configuration_get_maximum_processors() \
382  1
383 #endif
384 
385 #define rtems_configuration_get_rtems_api_configuration() \
386  (&Configuration_RTEMS_API)
387 
388 #define rtems_configuration_get_posix_api_configuration() \
389  (&Configuration_POSIX_API)
390 
391 #ifdef __cplusplus
392 }
393 #endif
394 
395 #endif
396 /* end of include file */
Constants and Structures Associated with the Object Handler.
uintptr_t stack_space_size
This field specifies the size in bytes of the RTEMS thread stack space.
Definition: config.h:137
MPCI Layer API.
The following records define the POSIX Configuration Table.
Definition: config.h:58
uint32_t microseconds_per_tick
This field specifies the number of microseconds which elapse between clock ticks. ...
Definition: config.h:165
bool stack_allocator_avoids_work_space
Specifies if the stack allocator avoids the work space.
Definition: config.h:238
rtems_stack_allocate_hook stack_allocate_hook
Optional task stack allocator hook.
Definition: config.h:208
uintptr_t work_space_size
This field specifies the size in bytes of the RTEMS Workspace.
Definition: config.h:132
bool unified_work_area
Specifies if a unified work area is used or not.
Definition: config.h:229
void(* rtems_stack_allocate_init_hook)(size_t stack_space_size)
Task stack allocator initialization hook.
Definition: config.h:98
const rtems_configuration_table Configuration
This is the configuration table generated by confdefs.h.
uint32_t maximum_extensions
This field specifies the maximum number of dynamically installed used extensions. ...
Definition: config.h:143
void(* rtems_stack_free_hook)(void *addr)
Task stack deallocator hook.
Definition: config.h:115
#define SAPI_EXTERN
The following ensures that all data is declared in the space of the initialization routine for either...
Definition: basedefs.h:95
uint32_t nanoseconds_per_tick
This field specifies the number of nanoseconds which elapse between clock ticks.
Definition: config.h:173
Definition: config.h:128
User Defined Configuration Parameters Specific For The POSIX API.
bool do_zero_of_workspace
If this element is TRUE, then RTEMS will zero the Executive Workspace.
Definition: config.h:221
uint32_t idle_task_stack_size
This field specifies the size of the IDLE task&#39;s stack.
Definition: config.h:191
User Extensions API.
uint32_t ticks_per_timeslice
This field specifies the number of ticks in each task&#39;s timeslice.
Definition: config.h:178
rtems_stack_free_hook stack_free_hook
Optional task stack free hook.
Definition: config.h:213
uint32_t interrupt_stack_size
This field specifies the size of the interrupt stack.
Definition: config.h:198
User extension table.
Definition: userext.h:232
void * Thread
The following defines the "return type" of a thread.
Definition: thread.h:99
uint32_t maximum_keys
This field contains the maximum number of POSIX API keys which are configured for this application...
Definition: config.h:149
uint32_t maximum_key_value_pairs
This field contains the maximum number of POSIX API key value pairs which are configured for this app...
Definition: config.h:159
void *(* rtems_stack_allocate_hook)(size_t stack_size)
Task stack allocator hook.
Definition: config.h:108
rtems_stack_allocate_init_hook stack_allocate_init_hook
Optional task stack allocator initialization hook.
Definition: config.h:203