1 | /** |
---|
2 | * @file rtems/config.h |
---|
3 | */ |
---|
4 | |
---|
5 | /* |
---|
6 | * This include file contains the table of user defined configuration |
---|
7 | * parameters. |
---|
8 | * |
---|
9 | * COPYRIGHT (c) 1989-2008. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.com/license/LICENSE. |
---|
15 | * |
---|
16 | * $Id$ |
---|
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 | /* |
---|
41 | * This is kind of kludgy but it allows targets to totally ignore the |
---|
42 | * optional APIs like POSIX and ITRON safely. |
---|
43 | */ |
---|
44 | |
---|
45 | #ifdef RTEMS_POSIX_API |
---|
46 | #include <rtems/posix/config.h> |
---|
47 | #else |
---|
48 | typedef void *posix_api_configuration_table; |
---|
49 | #endif |
---|
50 | |
---|
51 | #ifdef RTEMS_ITRON_API |
---|
52 | #include <rtems/itron.h> |
---|
53 | #include <rtems/itron/config.h> |
---|
54 | #else |
---|
55 | typedef void *itron_api_configuration_table; |
---|
56 | #endif |
---|
57 | |
---|
58 | #include <rtems/rtems/config.h> |
---|
59 | |
---|
60 | #include <rtems/extension.h> |
---|
61 | #include <rtems/io.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 | */ |
---|
73 | typedef 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 | /** The MPCI Receive server is assumed to have a stack of at least |
---|
84 | * minimum stack size. This field specifies the amount of extra |
---|
85 | * stack this task will be given in bytes. |
---|
86 | */ |
---|
87 | uint32_t extra_mpci_receive_server_stack; |
---|
88 | |
---|
89 | /** This is a pointer to User/BSP provided MPCI Table. */ |
---|
90 | rtems_mpci_table *User_mpci_table; |
---|
91 | } rtems_multiprocessing_table; |
---|
92 | #endif |
---|
93 | |
---|
94 | /* |
---|
95 | * The following records define the Configuration Table. The |
---|
96 | * information contained in this table is required in all |
---|
97 | * RTEMS systems, whether single or multiprocessor. This |
---|
98 | * table primarily defines the following: |
---|
99 | * |
---|
100 | * + location and size of the RTEMS Workspace |
---|
101 | * + microseconds per clock tick |
---|
102 | * + clock ticks per task timeslice |
---|
103 | * + required number of each object type for each API configured |
---|
104 | */ |
---|
105 | typedef struct { |
---|
106 | /** This field specifies the base address of the RTEMS Workspace. |
---|
107 | */ |
---|
108 | void *work_space_start; |
---|
109 | |
---|
110 | /** This field specifies the size in bytes of the RTEMS Workspace. |
---|
111 | */ |
---|
112 | intptr_t work_space_size; |
---|
113 | |
---|
114 | /** This field specifies the maximum number of dynamically installed |
---|
115 | * used extensions. |
---|
116 | */ |
---|
117 | uint32_t maximum_extensions; |
---|
118 | |
---|
119 | /** This field specifies the number of microseconds which elapse |
---|
120 | * between clock ticks. This is the basis for RTEMS timing. |
---|
121 | */ |
---|
122 | uint32_t microseconds_per_tick; |
---|
123 | |
---|
124 | /** This field specifies the number of ticks in each task's timeslice. |
---|
125 | */ |
---|
126 | uint32_t ticks_per_timeslice; |
---|
127 | |
---|
128 | /** This element points to the BSP's optional idle task which may override |
---|
129 | * the default one provided with RTEMS. |
---|
130 | */ |
---|
131 | Thread (*idle_task)( uint32_t ); |
---|
132 | |
---|
133 | /** This field specifies the size of the IDLE task's stack. If less than or |
---|
134 | * equal to the minimum stack size, then the IDLE task will have the minimum |
---|
135 | * stack size. |
---|
136 | */ |
---|
137 | uint32_t idle_task_stack_size; |
---|
138 | |
---|
139 | /** This field specifies the size of the interrupt stack. If less than or |
---|
140 | * equal to the minimum stack size, then the interrupt stack will be of |
---|
141 | * minimum stack size. |
---|
142 | */ |
---|
143 | uint32_t interrupt_stack_size; |
---|
144 | |
---|
145 | /** The BSP may want to provide it's own stack allocation routines. |
---|
146 | * In this case, the BSP will provide this stack allocation hook. |
---|
147 | */ |
---|
148 | void * (*stack_allocate_hook)( uint32_t ); |
---|
149 | |
---|
150 | /** The BSP may want to provide it's own stack free routines. |
---|
151 | * In this case, the BSP will provide this stack free hook. |
---|
152 | */ |
---|
153 | void (*stack_free_hook)( void *); |
---|
154 | |
---|
155 | /** If this element is TRUE, then RTEMS will zero the Executive Workspace. |
---|
156 | * When this element is FALSE, it is assumed that the BSP or invoking |
---|
157 | * environment has ensured that memory was cleared before RTEMS was |
---|
158 | * invoked. |
---|
159 | */ |
---|
160 | bool do_zero_of_workspace; |
---|
161 | |
---|
162 | uint32_t maximum_drivers; |
---|
163 | uint32_t number_of_device_drivers; |
---|
164 | rtems_driver_address_table *Device_driver_table; |
---|
165 | uint32_t number_of_initial_extensions; |
---|
166 | rtems_extensions_table *User_extension_table; |
---|
167 | #if defined(RTEMS_MULTIPROCESSING) |
---|
168 | rtems_multiprocessing_table *User_multiprocessing_table; |
---|
169 | #endif |
---|
170 | } rtems_configuration_table; |
---|
171 | |
---|
172 | /** |
---|
173 | * This is the configuration table generated by confdefs.h. |
---|
174 | */ |
---|
175 | extern rtems_configuration_table Configuration; |
---|
176 | |
---|
177 | #if defined(RTEMS_MULTIPROCESSING) |
---|
178 | /** |
---|
179 | * This points to the multiprocessing configuration table. |
---|
180 | */ |
---|
181 | SAPI_EXTERN rtems_multiprocessing_table *_Configuration_MP_table; |
---|
182 | #endif |
---|
183 | |
---|
184 | /* |
---|
185 | * Some handy macros to avoid dependencies on either the BSP |
---|
186 | * or the exact format of the configuration table. |
---|
187 | */ |
---|
188 | |
---|
189 | #define rtems_configuration_get_table() \ |
---|
190 | (&Configuration) |
---|
191 | |
---|
192 | #define rtems_configuration_get_work_space_start() \ |
---|
193 | (Configuration.work_space_start) |
---|
194 | |
---|
195 | #define rtems_configuration_get_work_space_size() \ |
---|
196 | (Configuration.work_space_size) |
---|
197 | |
---|
198 | #define rtems_configuration_get_maximum_extensions() \ |
---|
199 | (Configuration.maximum_extensions) |
---|
200 | |
---|
201 | #define rtems_configuration_get_microseconds_per_tick() \ |
---|
202 | (Configuration.microseconds_per_tick) |
---|
203 | #define rtems_configuration_get_milliseconds_per_tick() \ |
---|
204 | (Configuration.microseconds_per_tick / 1000) |
---|
205 | #define rtems_configuration_get_nanoseconds_per_tick() \ |
---|
206 | (Configuration.microseconds_per_tick * 1000) |
---|
207 | |
---|
208 | #define rtems_configuration_get_ticks_per_timeslice() \ |
---|
209 | (Configuration.ticks_per_timeslice) |
---|
210 | |
---|
211 | #define rtems_configuration_get_idle_task() \ |
---|
212 | (Configuration.idle_task) |
---|
213 | |
---|
214 | #define rtems_configuration_get_idle_task_stack_size() \ |
---|
215 | (Configuration.idle_task_stack_size) |
---|
216 | |
---|
217 | /* XXX We need to get this from the generated table |
---|
218 | * since BSPs need it before the pointer is set. |
---|
219 | * Eventually all should be done this way. |
---|
220 | */ |
---|
221 | extern rtems_configuration_table Configuration; |
---|
222 | |
---|
223 | #define rtems_configuration_get_interrupt_stack_size() \ |
---|
224 | (Configuration.interrupt_stack_size) |
---|
225 | |
---|
226 | #define rtems_configuration_get_stack_allocate_hook() \ |
---|
227 | (Configuration.stack_allocate_hook) |
---|
228 | |
---|
229 | #define rtems_configuration_get_stack_free_hook() \ |
---|
230 | (Configuration.stack_free_hook) |
---|
231 | |
---|
232 | /** |
---|
233 | * This macro assists in accessing the field which indicates whether |
---|
234 | * RTEMS is responsible for zeroing the Executive Workspace. |
---|
235 | */ |
---|
236 | #define rtems_configuration_get_do_zero_of_workspace() \ |
---|
237 | (Configuration.do_zero_of_workspace) |
---|
238 | |
---|
239 | #define rtems_configuration_get_number_of_device_drivers() \ |
---|
240 | (Configuration.number_of_device_drivers) |
---|
241 | |
---|
242 | #define rtems_configuration_get_device_driver_table() \ |
---|
243 | (Configuration.device_driver_table) |
---|
244 | |
---|
245 | #define rtems_configuration_get_number_of_initial_extensions() \ |
---|
246 | (Configuration.number_of_initial_extensions) |
---|
247 | |
---|
248 | #define rtems_configuration_get_user_extension_table() \ |
---|
249 | (Configuration.user_extension_table) |
---|
250 | |
---|
251 | #if defined(RTEMS_MULTIPROCESSING) |
---|
252 | #define rtems_configuration_get_user_multiprocessing_table() \ |
---|
253 | (Configuration.User_multiprocessing_table) |
---|
254 | #else |
---|
255 | #define rtems_configuration_get_user_multiprocessing_table() NULL |
---|
256 | #endif |
---|
257 | |
---|
258 | #define rtems_configuration_get_rtems_api_configuration() \ |
---|
259 | (&Configuration_RTEMS_API) |
---|
260 | |
---|
261 | #define rtems_configuration_get_posix_api_configuration() \ |
---|
262 | (&Configuration_POSIX_API) |
---|
263 | |
---|
264 | #define rtems_configuration_get_itron_api_configuration() \ |
---|
265 | (&Configuration_ITRON_API) |
---|
266 | |
---|
267 | #ifdef __cplusplus |
---|
268 | } |
---|
269 | #endif |
---|
270 | |
---|
271 | #endif |
---|
272 | /* end of include file */ |
---|