1 | /** |
---|
2 | * @file rtems/confdefs.h |
---|
3 | * |
---|
4 | * This include file contains the configuration table template that will |
---|
5 | * be instantiated by an application based on the setting of a number |
---|
6 | * of macros. The macros are documented in the Configuring a System |
---|
7 | * chapter of the Classic API User's Guide |
---|
8 | * |
---|
9 | * The model is to estimate the memory required for each configured item |
---|
10 | * and sum those estimates. The estimate can be too high or too low for |
---|
11 | * a variety of reasons: |
---|
12 | * |
---|
13 | * Reasons estimate is too high: |
---|
14 | * + FP contexts (not all tasks are FP) |
---|
15 | * |
---|
16 | * Reasons estimate is too low: |
---|
17 | * + stacks greater than minimum size |
---|
18 | * + messages |
---|
19 | * + application must account for device driver resources |
---|
20 | * + application must account for add-on library resource requirements |
---|
21 | * |
---|
22 | * NOTE: Eventually this may be able to take into account some of |
---|
23 | * the above. This procedure has evolved from just enough to |
---|
24 | * support the RTEMS Test Suites into something that can be |
---|
25 | * used remarkably reliably by most applications. |
---|
26 | */ |
---|
27 | |
---|
28 | /* |
---|
29 | * COPYRIGHT (c) 1989-2010. |
---|
30 | * On-Line Applications Research Corporation (OAR). |
---|
31 | * |
---|
32 | * The license and distribution terms for this file may be |
---|
33 | * found in the file LICENSE in this distribution or at |
---|
34 | * http://www.rtems.com/license/LICENSE. |
---|
35 | * |
---|
36 | * $Id$ |
---|
37 | */ |
---|
38 | |
---|
39 | #ifndef __CONFIGURATION_TEMPLATE_h |
---|
40 | #define __CONFIGURATION_TEMPLATE_h |
---|
41 | |
---|
42 | /* |
---|
43 | * Include the executive's configuration |
---|
44 | */ |
---|
45 | #include <rtems/score/cpuopts.h> |
---|
46 | #include <rtems/score/apimutex.h> |
---|
47 | |
---|
48 | #ifdef __cplusplus |
---|
49 | extern "C" { |
---|
50 | #endif |
---|
51 | |
---|
52 | extern rtems_initialization_tasks_table Initialization_tasks[]; |
---|
53 | extern rtems_driver_address_table Device_drivers[]; |
---|
54 | extern rtems_configuration_table Configuration; |
---|
55 | #if defined(RTEMS_MULTIPROCESSING) |
---|
56 | extern rtems_multiprocessing_table Multiprocessing_configuration; |
---|
57 | #endif |
---|
58 | #ifdef RTEMS_POSIX_API |
---|
59 | extern posix_api_configuration_table Configuration_POSIX_API; |
---|
60 | #endif |
---|
61 | |
---|
62 | /** |
---|
63 | * This macro determines whether the RTEMS reentrancy support for |
---|
64 | * the Newlib C Library is enabled. |
---|
65 | */ |
---|
66 | #if (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) |
---|
67 | #define CONFIGURE_NEWLIB_EXTENSION 1 |
---|
68 | #else |
---|
69 | #define CONFIGURE_NEWLIB_EXTENSION 0 |
---|
70 | #endif |
---|
71 | |
---|
72 | #include <rtems/libio.h> |
---|
73 | |
---|
74 | #ifdef CONFIGURE_INIT |
---|
75 | rtems_libio_init_functions_t rtems_libio_init_helper = |
---|
76 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
77 | NULL; |
---|
78 | #else |
---|
79 | rtems_libio_init; |
---|
80 | #endif |
---|
81 | |
---|
82 | rtems_libio_supp_functions_t rtems_libio_supp_helper = |
---|
83 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
84 | NULL; |
---|
85 | #else |
---|
86 | open_dev_console; |
---|
87 | #endif |
---|
88 | |
---|
89 | rtems_fs_init_functions_t rtems_fs_init_helper = |
---|
90 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
91 | NULL; |
---|
92 | #else |
---|
93 | rtems_filesystem_initialize; |
---|
94 | #endif |
---|
95 | #endif |
---|
96 | |
---|
97 | |
---|
98 | /* |
---|
99 | * If the application disables the filesystem, they will not need |
---|
100 | * a mount table, so do not produce one. |
---|
101 | */ |
---|
102 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
103 | #define CONFIGURE_HAS_OWN_MOUNT_TABLE |
---|
104 | #endif |
---|
105 | |
---|
106 | /** |
---|
107 | * This macro defines the number of POSIX file descriptors allocated |
---|
108 | * and managed by libio. These are the "integer" file descriptors that |
---|
109 | * are used by calls like open(2) and read(2). |
---|
110 | */ |
---|
111 | #ifndef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS |
---|
112 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 3 |
---|
113 | #endif |
---|
114 | |
---|
115 | /** |
---|
116 | * From the number of file descriptors, we can determine how many |
---|
117 | * semaphores the implementation will require. |
---|
118 | */ |
---|
119 | #define CONFIGURE_LIBIO_SEMAPHORES \ |
---|
120 | (CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS + 1) |
---|
121 | |
---|
122 | #ifdef CONFIGURE_INIT |
---|
123 | /** |
---|
124 | * When instantiating the configuration tables, this variable is |
---|
125 | * initialized to specify the maximum number of file descriptors. |
---|
126 | */ |
---|
127 | uint32_t rtems_libio_number_iops = CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS; |
---|
128 | #endif |
---|
129 | |
---|
130 | /** |
---|
131 | * This macro determines if termios is disabled by this application. |
---|
132 | * This only means that resources will not be reserved. If you end |
---|
133 | * up using termios, it will fail. |
---|
134 | */ |
---|
135 | #ifdef CONFIGURE_TERMIOS_DISABLED |
---|
136 | #define CONFIGURE_TERMIOS_SEMAPHORES 0 |
---|
137 | #else |
---|
138 | /** |
---|
139 | * This macro specifies the number of serial or PTY ports that will |
---|
140 | * use termios. |
---|
141 | */ |
---|
142 | #ifndef CONFIGURE_NUMBER_OF_TERMIOS_PORTS |
---|
143 | #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 1 |
---|
144 | #endif |
---|
145 | |
---|
146 | /** |
---|
147 | * This macro reserves the number of semaphores required by termios |
---|
148 | * based upon the number of communication ports that will use it. |
---|
149 | */ |
---|
150 | #define CONFIGURE_TERMIOS_SEMAPHORES \ |
---|
151 | ((CONFIGURE_NUMBER_OF_TERMIOS_PORTS * 4) + 1) |
---|
152 | #endif |
---|
153 | |
---|
154 | /** |
---|
155 | * This macro specifies the number of PTYs that can be concurrently |
---|
156 | * active. |
---|
157 | */ |
---|
158 | #ifndef CONFIGURE_MAXIMUM_PTYS |
---|
159 | #define CONFIGURE_MAXIMUM_PTYS 0 |
---|
160 | #endif |
---|
161 | |
---|
162 | /** |
---|
163 | * This variable contains the maximum number of PTYs that can be |
---|
164 | * concurrently active. |
---|
165 | */ |
---|
166 | #ifdef CONFIGURE_INIT |
---|
167 | int rtems_telnetd_maximum_ptys = CONFIGURE_MAXIMUM_PTYS; |
---|
168 | #else |
---|
169 | extern int rtems_telnetd_maximum_ptys; |
---|
170 | #endif |
---|
171 | |
---|
172 | /* |
---|
173 | * Filesystems and Mount Table Configuration. |
---|
174 | * |
---|
175 | * Defines to control the file system: |
---|
176 | * |
---|
177 | * CONFIGURE_APPLICATION_DISABLE_FILESYSTEM: |
---|
178 | * Disable the RTEMS filesystems. You get an empty DEVFS. |
---|
179 | * |
---|
180 | * CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM: |
---|
181 | * Use the DEVFS as the root file system. Limited functions are |
---|
182 | * provided when this is used. |
---|
183 | * |
---|
184 | * CONFIGURE_FILESYSTEM_ALL: |
---|
185 | * Add file filesystems to the default filesystem table. |
---|
186 | * |
---|
187 | * List of available file systems. You can define as many as you like: |
---|
188 | * CONFIGURE_FILESYSTEM_miniIMFS - MiniIMFS, use DEVFS now |
---|
189 | * CONFIGURE_FILESYSTEM_IMFS - In Memory File System (IMFS) |
---|
190 | * CONFIGURE_FILESYSTEM_DEVFS - Device File System (DSVFS) |
---|
191 | * CONFIGURE_FILESYSTEM_TFTPFS - TFTP File System, networking enabled |
---|
192 | * CONFIGURE_FILESYSTEM_FTPFS - FTP File System, networking enabled |
---|
193 | * CONFIGURE_FILESYSTEM_NFSFS - Network File System, networking enabled |
---|
194 | * CONFIGURE_FILESYSTEM_DOSFS - DOS File System, uses libblock |
---|
195 | * CONFIGURE_FILESYSTEM_RFS - RTEMS File System (RFS), uses libblock |
---|
196 | * |
---|
197 | * Combinations: |
---|
198 | * |
---|
199 | * - If nothing is defined the base file system is the IMFS. |
---|
200 | * |
---|
201 | * - If CONFIGURE_APPLICATION_DISABLE_FILESYSTEM is defined all filesystem |
---|
202 | * are disabled by force and an empty DEVFS is created. |
---|
203 | * |
---|
204 | * - If CONFIGURE_USE_DEV_AS_BASE_FILESYSTEM is defined all filesystem |
---|
205 | * are disabled by force and DEVFS is defined. |
---|
206 | */ |
---|
207 | |
---|
208 | #ifdef CONFIGURE_INIT |
---|
209 | |
---|
210 | /* |
---|
211 | * Include all file systems. Do this before checking if the filesystem has |
---|
212 | * been disabled. |
---|
213 | */ |
---|
214 | #ifdef CONFIGURE_FILESYSTEM_ALL |
---|
215 | #define CONFIGURE_FILESYSTEM_miniIMFS |
---|
216 | #define CONFIGURE_FILESYSTEM_IMFS |
---|
217 | #define CONFIGURE_FILESYSTEM_DEVFS |
---|
218 | #define CONFIGURE_FILESYSTEM_TFTPFS |
---|
219 | #define CONFIGURE_FILESYSTEM_FTPFS |
---|
220 | #define CONFIGURE_FILESYSTEM_NFSFS |
---|
221 | #define CONFIGURE_FILESYSTEM_DOSFS |
---|
222 | #define CONFIGURE_FILESYSTEM_RFS |
---|
223 | #endif |
---|
224 | |
---|
225 | /* |
---|
226 | * If disabling the file system undef everything. If DEVFS as the base |
---|
227 | * filesystem undefine all other filesystems because you cannot mount other |
---|
228 | * filesystems. Same for miniIMFS. |
---|
229 | */ |
---|
230 | #if defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) || \ |
---|
231 | defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) || \ |
---|
232 | defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM) |
---|
233 | #if defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) |
---|
234 | #undef CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM |
---|
235 | #undef CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM |
---|
236 | #elif defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
237 | #undef CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM |
---|
238 | #endif |
---|
239 | #undef CONFIGURE_FILESYSTEM_miniIMFS |
---|
240 | #undef CONFIGURE_FILESYSTEM_IMFS |
---|
241 | #undef CONFIGURE_FILESYSTEM_DEVFS |
---|
242 | #undef CONFIGURE_FILESYSTEM_TFTPFS |
---|
243 | #undef CONFIGURE_FILESYSTEM_FTPFS |
---|
244 | #undef CONFIGURE_FILESYSTEM_NFSFS |
---|
245 | #undef CONFIGURE_FILESYSTEM_DOSFS |
---|
246 | #undef CONFIGURE_FILESYSTEM_RFS |
---|
247 | #endif |
---|
248 | |
---|
249 | /* |
---|
250 | * If the base filesystem is DEVFS define it else define IMFS. |
---|
251 | * We will have either DEVFS or IMFS defined after this. |
---|
252 | */ |
---|
253 | #if !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) |
---|
254 | #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
255 | #define CONFIGURE_FILESYSTEM_DEVFS |
---|
256 | #elif defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM) |
---|
257 | #define CONFIGURE_FILESYSTEM_miniIMFS |
---|
258 | #elif !defined(CONFIGURE_FILESYSTEM_IMFS) |
---|
259 | #define CONFIGURE_FILESYSTEM_IMFS |
---|
260 | #endif |
---|
261 | #endif |
---|
262 | |
---|
263 | #endif |
---|
264 | |
---|
265 | /** |
---|
266 | * IMFS |
---|
267 | */ |
---|
268 | #include <rtems/imfs.h> |
---|
269 | |
---|
270 | /** |
---|
271 | * This specifies the number of bytes per block for files within the IMFS. |
---|
272 | * There are a maximum number of blocks per file so this dictates the maximum |
---|
273 | * size of a file. This has to be balanced with the unused portion of each |
---|
274 | * block that might be wasted. |
---|
275 | */ |
---|
276 | #ifndef CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK |
---|
277 | #define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK \ |
---|
278 | IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK |
---|
279 | #endif |
---|
280 | |
---|
281 | /** |
---|
282 | * This defines the miniIMFS file system table entry. |
---|
283 | */ |
---|
284 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_miniIMFS) && \ |
---|
285 | defined(CONFIGURE_FILESYSTEM_miniIMFS) |
---|
286 | #define CONFIGURE_FILESYSTEM_ENTRY_miniIMFS \ |
---|
287 | { RTEMS_FILESYSTEM_TYPE_MINIIMFS, miniIMFS_initialize } |
---|
288 | #endif |
---|
289 | |
---|
290 | /** |
---|
291 | * This defines the IMFS file system table entry. |
---|
292 | */ |
---|
293 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS) && \ |
---|
294 | defined(CONFIGURE_FILESYSTEM_IMFS) |
---|
295 | #if defined(CONFIGURE_PIPES_ENABLED) |
---|
296 | #define CONFIGURE_FILESYSTEM_ENTRY_IMFS \ |
---|
297 | { RTEMS_FILESYSTEM_TYPE_IMFS, fifoIMFS_initialize } |
---|
298 | #else |
---|
299 | #define CONFIGURE_FILESYSTEM_ENTRY_IMFS \ |
---|
300 | { RTEMS_FILESYSTEM_TYPE_IMFS, IMFS_initialize } |
---|
301 | #endif |
---|
302 | #endif |
---|
303 | |
---|
304 | /** |
---|
305 | * DEVFS |
---|
306 | */ |
---|
307 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS) && \ |
---|
308 | defined(CONFIGURE_FILESYSTEM_DEVFS) |
---|
309 | #include <rtems/devfs.h> |
---|
310 | #define CONFIGURE_FILESYSTEM_ENTRY_DEVFS \ |
---|
311 | { RTEMS_FILESYSTEM_TYPE_DEVFS, devFS_initialize } |
---|
312 | #endif |
---|
313 | |
---|
314 | #ifdef RTEMS_NETWORKING |
---|
315 | /** |
---|
316 | * FTPFS |
---|
317 | */ |
---|
318 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS) && \ |
---|
319 | defined(CONFIGURE_FILESYSTEM_FTPFS) |
---|
320 | #include <rtems/ftpfs.h> |
---|
321 | #define CONFIGURE_FILESYSTEM_ENTRY_FTPFS \ |
---|
322 | { RTEMS_FILESYSTEM_TYPE_FTPFS, rtems_ftpfs_initialize } |
---|
323 | #endif |
---|
324 | |
---|
325 | /** |
---|
326 | * TFTPFS |
---|
327 | */ |
---|
328 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS) && \ |
---|
329 | defined(CONFIGURE_FILESYSTEM_TFTPFS) |
---|
330 | #include <rtems/tftp.h> |
---|
331 | #define CONFIGURE_FILESYSTEM_ENTRY_TFTPFS \ |
---|
332 | { RTEMS_FILESYSTEM_TYPE_TFTPFS, rtems_tftpfs_initialize } |
---|
333 | #endif |
---|
334 | |
---|
335 | /** |
---|
336 | * NFSFS |
---|
337 | */ |
---|
338 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_NFSFS) && \ |
---|
339 | defined(CONFIGURE_FILESYSTEM_NFSFS) |
---|
340 | #include <librtemsNfs.h> |
---|
341 | #define CONFIGURE_FILESYSTEM_ENTRY_NFSFS \ |
---|
342 | { RTEMS_FILESYSTEM_TYPE_NFS, rtems_nfsfs_initialize } |
---|
343 | #endif |
---|
344 | #endif |
---|
345 | |
---|
346 | /** |
---|
347 | * DOSFS |
---|
348 | */ |
---|
349 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS) && \ |
---|
350 | defined(CONFIGURE_FILESYSTEM_DOSFS) |
---|
351 | #include <rtems/dosfs.h> |
---|
352 | #define CONFIGURE_FILESYSTEM_ENTRY_DOSFS \ |
---|
353 | { RTEMS_FILESYSTEM_TYPE_DOSFS, rtems_dosfs_initialize } |
---|
354 | #endif |
---|
355 | |
---|
356 | /** |
---|
357 | * RFS |
---|
358 | */ |
---|
359 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_RFS) && \ |
---|
360 | defined(CONFIGURE_FILESYSTEM_RFS) |
---|
361 | #include <rtems/rtems-rfs.h> |
---|
362 | #define CONFIGURE_FILESYSTEM_ENTRY_RFS \ |
---|
363 | { RTEMS_FILESYSTEM_TYPE_RFS, rtems_rfs_rtems_initialise } |
---|
364 | #endif |
---|
365 | |
---|
366 | #ifdef CONFIGURE_INIT |
---|
367 | |
---|
368 | /* |
---|
369 | * DEVFS variables. |
---|
370 | */ |
---|
371 | #if defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) |
---|
372 | #define CONFIGURE_MEMORY_FOR_DEVFS 0 |
---|
373 | #elif defined(CONFIGURE_FILESYSTEM_DEVFS) |
---|
374 | #ifndef CONFIGURE_MAXIMUM_DEVICES |
---|
375 | #define CONFIGURE_MAXIMUM_DEVICES 4 |
---|
376 | #endif |
---|
377 | #include <rtems/devfs.h> |
---|
378 | uint32_t rtems_device_table_size = CONFIGURE_MAXIMUM_DEVICES; |
---|
379 | #define CONFIGURE_MEMORY_FOR_DEVFS \ |
---|
380 | _Configure_Object_RAM(CONFIGURE_MAXIMUM_DEVICES, \ |
---|
381 | sizeof (rtems_device_name_t)) |
---|
382 | #else |
---|
383 | #define CONFIGURE_MEMORY_FOR_DEVFS 0 |
---|
384 | #endif |
---|
385 | |
---|
386 | #if defined(CONFIGURE_FILESYSTEM_IMFS) || \ |
---|
387 | defined(CONFIGURE_FILESYSTEM_miniIMFS) |
---|
388 | int imfs_rq_memfile_bytes_per_block = CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK; |
---|
389 | #endif |
---|
390 | |
---|
391 | /** |
---|
392 | * Table termination record. |
---|
393 | */ |
---|
394 | #define CONFIGURE_FILESYSTEM_NULL { NULL, NULL } |
---|
395 | |
---|
396 | /** |
---|
397 | * The default file system table. Must be terminated with the NULL entry if |
---|
398 | * you provide your own. |
---|
399 | */ |
---|
400 | #ifndef CONFIGURE_HAS_OWN_FILESYSTEM_TABLE |
---|
401 | const rtems_filesystem_table_t rtems_filesystem_table[] = { |
---|
402 | #if defined(CONFIGURE_FILESYSTEM_miniIMFS) && \ |
---|
403 | defined(CONFIGURE_FILESYSTEM_ENTRY_miniIMFS) |
---|
404 | CONFIGURE_FILESYSTEM_ENTRY_miniIMFS, |
---|
405 | #endif |
---|
406 | #if defined(CONFIGURE_FILESYSTEM_IMFS) && \ |
---|
407 | defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS) |
---|
408 | CONFIGURE_FILESYSTEM_ENTRY_IMFS, |
---|
409 | #endif |
---|
410 | #if defined(CONFIGURE_FILESYSTEM_DEVFS) && \ |
---|
411 | defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS) |
---|
412 | CONFIGURE_FILESYSTEM_ENTRY_DEVFS, |
---|
413 | #endif |
---|
414 | #if defined(CONFIGURE_FILESYSTEM_TFTPFS) && \ |
---|
415 | defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS) |
---|
416 | CONFIGURE_FILESYSTEM_ENTRY_TFTPFS, |
---|
417 | #endif |
---|
418 | #if defined(CONFIGURE_FILESYSTEM_FTPFS) && \ |
---|
419 | defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS) |
---|
420 | CONFIGURE_FILESYSTEM_ENTRY_FTPFS, |
---|
421 | #endif |
---|
422 | #if defined(CONFIGURE_FILESYSTEM_NFSFS) && \ |
---|
423 | defined(CONFIGURE_FILESYSTEM_ENTRY_NFSFS) |
---|
424 | CONFIGURE_FILESYSTEM_ENTRY_NFSFS, |
---|
425 | #endif |
---|
426 | #if defined(CONFIGURE_FILESYSTEM_DOSFS) && \ |
---|
427 | defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS) |
---|
428 | CONFIGURE_FILESYSTEM_ENTRY_DOSFS, |
---|
429 | #endif |
---|
430 | #if defined(CONFIGURE_FILESYSTEM_RFS) && \ |
---|
431 | defined(CONFIGURE_FILESYSTEM_ENTRY_RFS) |
---|
432 | CONFIGURE_FILESYSTEM_ENTRY_RFS, |
---|
433 | #endif |
---|
434 | CONFIGURE_FILESYSTEM_NULL |
---|
435 | }; |
---|
436 | #endif |
---|
437 | |
---|
438 | #ifndef CONFIGURE_HAS_OWN_MOUNT_TABLE |
---|
439 | const rtems_filesystem_mount_table_t configuration_mount_table = { |
---|
440 | #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
441 | RTEMS_FILESYSTEM_TYPE_DEVFS, |
---|
442 | #elif defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM) |
---|
443 | RTEMS_FILESYSTEM_TYPE_MINIIMFS, |
---|
444 | #else /* using IMFS as base filesystem */ |
---|
445 | RTEMS_FILESYSTEM_TYPE_IMFS, |
---|
446 | #endif |
---|
447 | RTEMS_FILESYSTEM_READ_WRITE, |
---|
448 | NULL, |
---|
449 | NULL |
---|
450 | }; |
---|
451 | |
---|
452 | const rtems_filesystem_mount_table_t |
---|
453 | *rtems_filesystem_mount_table = &configuration_mount_table; |
---|
454 | const int rtems_filesystem_mount_table_size = 1; |
---|
455 | #endif |
---|
456 | |
---|
457 | #endif |
---|
458 | |
---|
459 | /* |
---|
460 | * STACK_CHECER_ON was still available in 4.9 so give a warning for now. |
---|
461 | */ |
---|
462 | #if defined(STACK_CHECKER_ON) |
---|
463 | #define CONFIGURE_STACK_CHECKER_ENABLED |
---|
464 | #warning "STACK_CHECKER_ON deprecated -- use CONFIGURE_STACK_CHECKER_ENABLED" |
---|
465 | #endif |
---|
466 | |
---|
467 | /** |
---|
468 | * This configures the stack checker user extension. |
---|
469 | */ |
---|
470 | #ifdef CONFIGURE_STACK_CHECKER_ENABLED |
---|
471 | #define CONFIGURE_STACK_CHECKER_EXTENSION 1 |
---|
472 | #else |
---|
473 | #define CONFIGURE_STACK_CHECKER_EXTENSION 0 |
---|
474 | #endif |
---|
475 | |
---|
476 | /** |
---|
477 | * @brief Maximum Priority configuration |
---|
478 | * |
---|
479 | * This configures the maximum priority value that |
---|
480 | * a task may have. |
---|
481 | * |
---|
482 | * By reducing the number of priorities in a system, |
---|
483 | * the amount of RAM required by RTEMS can be significantly |
---|
484 | * reduced. RTEMS allocates a Chain_Control structure per |
---|
485 | * priority and this structure contains 3 pointers. So |
---|
486 | * the default is (256 * 12) = 3K on 32-bit architectures. |
---|
487 | * |
---|
488 | * This must be one less than a power of 2 between |
---|
489 | * 4 and 256. Valid values along with the application |
---|
490 | * priority levels and memory saved when pointers are |
---|
491 | * 32-bits in size are: |
---|
492 | * |
---|
493 | * + 3, 2 application priorities, 3024 bytes saved |
---|
494 | * + 7, 5 application priorities, 2976 bytes saved |
---|
495 | * + 15, 13 application priorities, 2880 bytes saved |
---|
496 | * + 31, 29 application priorities, 2688 bytes saved |
---|
497 | * + 63, 61 application priorities, 2304 bytes saved |
---|
498 | * + 127, 125 application priorities, 1536 bytes saved |
---|
499 | * + 255, 253 application priorities, 0 bytes saved |
---|
500 | * |
---|
501 | * It is specified in terms of Classic API |
---|
502 | * priority values. |
---|
503 | */ |
---|
504 | #ifndef CONFIGURE_MAXIMUM_PRIORITY |
---|
505 | #define CONFIGURE_MAXIMUM_PRIORITY PRIORITY_DEFAULT_MAXIMUM |
---|
506 | #endif |
---|
507 | |
---|
508 | /* |
---|
509 | * If you said the IDLE task was going to do application initialization |
---|
510 | * and didn't override the IDLE body, then something is amiss. |
---|
511 | */ |
---|
512 | #if (defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) && \ |
---|
513 | !defined(CONFIGURE_IDLE_TASK_BODY)) |
---|
514 | #error "CONFIGURE_ERROR: You did not override the IDLE task body." |
---|
515 | #endif |
---|
516 | |
---|
517 | /** |
---|
518 | * @brief Idle task body configuration |
---|
519 | * |
---|
520 | * There is a default IDLE thread body provided by RTEMS which |
---|
521 | * has the possibility of being CPU specific. There may be a |
---|
522 | * BSP specific override of the RTEMS default body and in turn, |
---|
523 | * the application may override and provide its own. |
---|
524 | */ |
---|
525 | #ifndef CONFIGURE_IDLE_TASK_BODY |
---|
526 | #if defined(BSP_IDLE_TASK_BODY) |
---|
527 | #define CONFIGURE_IDLE_TASK_BODY BSP_IDLE_TASK_BODY |
---|
528 | #elif (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE) |
---|
529 | #define CONFIGURE_IDLE_TASK_BODY _CPU_Thread_Idle_body |
---|
530 | #else |
---|
531 | /* only instantiate and compile if used */ |
---|
532 | #ifdef CONFIGURE_INIT |
---|
533 | void *_Thread_Idle_body(uintptr_t ignored) |
---|
534 | { |
---|
535 | for( ; ; ) ; |
---|
536 | return 0; /* to avoid warning */ |
---|
537 | } |
---|
538 | #endif |
---|
539 | #define CONFIGURE_IDLE_TASK_BODY _Thread_Idle_body |
---|
540 | #endif |
---|
541 | #endif |
---|
542 | |
---|
543 | /** |
---|
544 | * By default, use the minimum stack size requested by this port. |
---|
545 | */ |
---|
546 | #ifndef CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
547 | #define CONFIGURE_MINIMUM_TASK_STACK_SIZE CPU_STACK_MINIMUM_SIZE |
---|
548 | #endif |
---|
549 | |
---|
550 | /** |
---|
551 | * @brief Idle task stack size configuration |
---|
552 | * |
---|
553 | * By default, the IDLE task will have a stack of minimum size. |
---|
554 | * The BSP or application may override this value. |
---|
555 | */ |
---|
556 | #ifndef CONFIGURE_IDLE_TASK_STACK_SIZE |
---|
557 | #ifdef BSP_IDLE_TASK_STACK_SIZE |
---|
558 | #define CONFIGURE_IDLE_TASK_STACK_SIZE BSP_IDLE_TASK_STACK_SIZE |
---|
559 | #else |
---|
560 | #define CONFIGURE_IDLE_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
561 | #endif |
---|
562 | #endif |
---|
563 | |
---|
564 | /** |
---|
565 | * @brief Interrupt stack size configuration |
---|
566 | * |
---|
567 | * By default, the interrupt stack will be of minimum size. |
---|
568 | * The BSP or application may override this value. |
---|
569 | */ |
---|
570 | #ifndef CONFIGURE_INTERRUPT_STACK_SIZE |
---|
571 | #ifdef BSP_INTERRUPT_STACK_SIZE |
---|
572 | #define CONFIGURE_INTERRUPT_STACK_SIZE BSP_INTERRUPT_STACK_SIZE |
---|
573 | #else |
---|
574 | #define CONFIGURE_INTERRUPT_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
575 | #endif |
---|
576 | #endif |
---|
577 | |
---|
578 | /** |
---|
579 | * This reserves memory for the interrupt stack if it is to be allocated |
---|
580 | * by RTEMS rather than the BSP. |
---|
581 | * |
---|
582 | * @todo Try to get to the point where all BSPs support allocating the |
---|
583 | * memory from the Workspace. |
---|
584 | */ |
---|
585 | #if (CPU_ALLOCATE_INTERRUPT_STACK == 0) |
---|
586 | #define CONFIGURE_INTERRUPT_STACK_MEMORY 0 |
---|
587 | #else |
---|
588 | #define CONFIGURE_INTERRUPT_STACK_MEMORY \ |
---|
589 | _Configure_From_workspace( CONFIGURE_INTERRUPT_STACK_SIZE ) |
---|
590 | #endif |
---|
591 | |
---|
592 | /** |
---|
593 | * Configure the very much optional task stack allocator |
---|
594 | */ |
---|
595 | #ifndef CONFIGURE_TASK_STACK_ALLOCATOR |
---|
596 | #define CONFIGURE_TASK_STACK_ALLOCATOR NULL |
---|
597 | #endif |
---|
598 | |
---|
599 | /** |
---|
600 | * Configure the very much optional task stack deallocator |
---|
601 | */ |
---|
602 | #ifndef CONFIGURE_TASK_STACK_DEALLOCATOR |
---|
603 | #define CONFIGURE_TASK_STACK_DEALLOCATOR NULL |
---|
604 | #endif |
---|
605 | |
---|
606 | /** |
---|
607 | * Should the RTEMS Workspace and C Program Heap be cleared automatically |
---|
608 | * at system start up? |
---|
609 | */ |
---|
610 | #ifndef CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY |
---|
611 | #ifdef BSP_ZERO_WORKSPACE_AUTOMATICALLY |
---|
612 | #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY \ |
---|
613 | BSP_ZERO_WORKSPACE_AUTOMATICALLY |
---|
614 | #else |
---|
615 | #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY FALSE |
---|
616 | #endif |
---|
617 | #endif |
---|
618 | |
---|
619 | /* |
---|
620 | * RTEMS Malloc configuration |
---|
621 | */ |
---|
622 | |
---|
623 | #include <rtems/malloc.h> |
---|
624 | |
---|
625 | #ifdef CONFIGURE_INIT |
---|
626 | /** |
---|
627 | * By default, RTEMS uses separate heaps for the RTEMS Workspace and |
---|
628 | * the C Program Heap. On many BSPs, these can be optionally |
---|
629 | * combined provided one larger memory pool. This is particularly |
---|
630 | * useful in combination with the unlimited objects configuration. |
---|
631 | */ |
---|
632 | #ifdef CONFIGURE_UNIFIED_WORK_AREAS |
---|
633 | #include <rtems/score/wkspace.h> |
---|
634 | Heap_Control *RTEMS_Malloc_Heap = &_Workspace_Area; |
---|
635 | bool rtems_unified_work_area = true; |
---|
636 | #else |
---|
637 | Heap_Control RTEMS_Malloc_Area; |
---|
638 | Heap_Control *RTEMS_Malloc_Heap = &RTEMS_Malloc_Area; |
---|
639 | bool rtems_unified_work_area = false; |
---|
640 | #endif |
---|
641 | #endif |
---|
642 | |
---|
643 | #ifdef CONFIGURE_INIT |
---|
644 | /** |
---|
645 | * This configures the malloc family statistics to be available. |
---|
646 | * By default only function call counts are kept. |
---|
647 | */ |
---|
648 | rtems_malloc_statistics_functions_t *rtems_malloc_statistics_helpers = |
---|
649 | #ifndef CONFIGURE_MALLOC_STATISTICS |
---|
650 | NULL; |
---|
651 | #else |
---|
652 | &rtems_malloc_statistics_helpers_table; |
---|
653 | #endif |
---|
654 | #endif |
---|
655 | |
---|
656 | #ifdef CONFIGURE_INIT |
---|
657 | /** |
---|
658 | * This configures the sbrk() support for the malloc family. |
---|
659 | * By default it is assumed that the BSP provides all available |
---|
660 | * RAM to the malloc family implementation so sbrk()'ing to get |
---|
661 | * more memory would always fail anyway. |
---|
662 | */ |
---|
663 | rtems_malloc_sbrk_functions_t *rtems_malloc_sbrk_helpers = |
---|
664 | #ifndef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK |
---|
665 | NULL; |
---|
666 | #else |
---|
667 | &rtems_malloc_sbrk_helpers_table; |
---|
668 | #endif |
---|
669 | #endif |
---|
670 | |
---|
671 | #ifdef CONFIGURE_INIT |
---|
672 | /** |
---|
673 | * This configures the malloc family plugin which dirties memory |
---|
674 | * allocated. This is helpful for finding unitialized data structure |
---|
675 | * problems. |
---|
676 | */ |
---|
677 | rtems_malloc_dirtier_t *rtems_malloc_dirty_helper = |
---|
678 | #if defined(CONFIGURE_MALLOC_DIRTY) |
---|
679 | rtems_malloc_dirty_memory; |
---|
680 | #else |
---|
681 | NULL; |
---|
682 | #endif |
---|
683 | #endif |
---|
684 | |
---|
685 | /** |
---|
686 | * This is a helper macro used in calculations in this file. It is used |
---|
687 | * to noted when an element is allocated from the RTEMS Workspace and adds |
---|
688 | * a factor to account for heap overhead plus an alignment factor that |
---|
689 | * may be applied. |
---|
690 | */ |
---|
691 | #define _Configure_From_workspace(_size) \ |
---|
692 | (ssize_t)((_size) + (2 * sizeof(uint32_t)) + CPU_ALIGNMENT) |
---|
693 | |
---|
694 | /** |
---|
695 | * Do not use the unlimited bit as part of the multiplication |
---|
696 | * for memory usage. |
---|
697 | */ |
---|
698 | #define _Configure_Max_Objects(_max) \ |
---|
699 | ((_max) & ~RTEMS_UNLIMITED_OBJECTS) |
---|
700 | |
---|
701 | /** |
---|
702 | * This macro accounts for how memory for a set of configured objects is |
---|
703 | * allocated from the Executive Workspace. |
---|
704 | * |
---|
705 | * NOTE: It does NOT attempt to address the more complex case of unlimited |
---|
706 | * objects. |
---|
707 | */ |
---|
708 | #define _Configure_Object_RAM(_number, _size) \ |
---|
709 | ( _Configure_From_workspace(_Configure_Max_Objects(_number) * (_size)) + \ |
---|
710 | _Configure_From_workspace( \ |
---|
711 | ((_Configure_Max_Objects(_number) + 1) * sizeof(Objects_Control *)) + \ |
---|
712 | (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) \ |
---|
713 | ) \ |
---|
714 | ) |
---|
715 | |
---|
716 | /* |
---|
717 | * Default User Initialization Task Table. This table guarantees that |
---|
718 | * one user initialization table is defined. |
---|
719 | */ |
---|
720 | |
---|
721 | #ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
722 | |
---|
723 | #ifdef CONFIGURE_HAS_OWN_INIT_TASK_TABLE |
---|
724 | |
---|
725 | /* |
---|
726 | * The user is defining their own table information and setting the |
---|
727 | * appropriate variables. |
---|
728 | */ |
---|
729 | |
---|
730 | #else |
---|
731 | |
---|
732 | #ifndef CONFIGURE_INIT_TASK_NAME |
---|
733 | #define CONFIGURE_INIT_TASK_NAME rtems_build_name('U', 'I', '1', ' ') |
---|
734 | #endif |
---|
735 | |
---|
736 | #ifndef CONFIGURE_INIT_TASK_STACK_SIZE |
---|
737 | #define CONFIGURE_INIT_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
738 | #endif |
---|
739 | |
---|
740 | #ifndef CONFIGURE_INIT_TASK_PRIORITY |
---|
741 | #define CONFIGURE_INIT_TASK_PRIORITY 1 |
---|
742 | #endif |
---|
743 | |
---|
744 | #ifndef CONFIGURE_INIT_TASK_ATTRIBUTES |
---|
745 | #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES |
---|
746 | #endif |
---|
747 | |
---|
748 | #ifndef CONFIGURE_INIT_TASK_ENTRY_POINT |
---|
749 | #ifdef __cplusplus |
---|
750 | extern "C" { |
---|
751 | #endif |
---|
752 | rtems_task Init (rtems_task_argument ); |
---|
753 | #ifdef __cplusplus |
---|
754 | } |
---|
755 | #endif |
---|
756 | #define CONFIGURE_INIT_TASK_ENTRY_POINT Init |
---|
757 | extern const char* bsp_boot_cmdline; |
---|
758 | #define CONFIGURE_INIT_TASK_ARGUMENTS ((rtems_task_argument) &bsp_boot_cmdline) |
---|
759 | #endif |
---|
760 | |
---|
761 | #ifndef CONFIGURE_INIT_TASK_INITIAL_MODES |
---|
762 | #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT |
---|
763 | #endif |
---|
764 | |
---|
765 | #ifndef CONFIGURE_INIT_TASK_ARGUMENTS |
---|
766 | #define CONFIGURE_INIT_TASK_ARGUMENTS 0 |
---|
767 | #endif |
---|
768 | |
---|
769 | #ifdef CONFIGURE_INIT |
---|
770 | rtems_initialization_tasks_table Initialization_tasks[] = { |
---|
771 | { CONFIGURE_INIT_TASK_NAME, |
---|
772 | CONFIGURE_INIT_TASK_STACK_SIZE, |
---|
773 | CONFIGURE_INIT_TASK_PRIORITY, |
---|
774 | CONFIGURE_INIT_TASK_ATTRIBUTES, |
---|
775 | CONFIGURE_INIT_TASK_ENTRY_POINT, |
---|
776 | CONFIGURE_INIT_TASK_INITIAL_MODES, |
---|
777 | CONFIGURE_INIT_TASK_ARGUMENTS |
---|
778 | } |
---|
779 | }; |
---|
780 | #endif |
---|
781 | |
---|
782 | #define CONFIGURE_INIT_TASK_TABLE Initialization_tasks |
---|
783 | |
---|
784 | #define CONFIGURE_INIT_TASK_TABLE_SIZE \ |
---|
785 | sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table) |
---|
786 | |
---|
787 | #endif /* CONFIGURE_HAS_OWN_INIT_TASK_TABLE */ |
---|
788 | |
---|
789 | #else /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */ |
---|
790 | |
---|
791 | #define CONFIGURE_INIT_TASK_TABLE NULL |
---|
792 | #define CONFIGURE_INIT_TASK_TABLE_SIZE 0 |
---|
793 | #define CONFIGURE_INIT_TASK_STACK_SIZE 0 |
---|
794 | |
---|
795 | #endif |
---|
796 | |
---|
797 | /* |
---|
798 | * Default Device Driver Table. Each driver needed by the test is explicitly |
---|
799 | * choosen by that test. There is always a null driver entry. |
---|
800 | */ |
---|
801 | |
---|
802 | #define NULL_DRIVER_TABLE_ENTRY \ |
---|
803 | { NULL, NULL, NULL, NULL, NULL, NULL } |
---|
804 | |
---|
805 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
806 | #include <rtems/console.h> |
---|
807 | #endif |
---|
808 | |
---|
809 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
810 | #include <rtems/clockdrv.h> |
---|
811 | #endif |
---|
812 | |
---|
813 | #ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER |
---|
814 | #include <rtems/timerdrv.h> |
---|
815 | #endif |
---|
816 | |
---|
817 | #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER |
---|
818 | #include <rtems/rtc.h> |
---|
819 | #endif |
---|
820 | |
---|
821 | #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER |
---|
822 | #include <rtems/watchdogdrv.h> |
---|
823 | #endif |
---|
824 | |
---|
825 | #ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER |
---|
826 | #include <rtems/framebuffer.h> |
---|
827 | #endif |
---|
828 | |
---|
829 | #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER |
---|
830 | #include <rtems/devnull.h> |
---|
831 | #endif |
---|
832 | |
---|
833 | #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER |
---|
834 | /* the ide driver needs the ATA driver */ |
---|
835 | #ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
836 | #define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
837 | #endif |
---|
838 | #include <libchip/ide_ctrl.h> |
---|
839 | #endif |
---|
840 | |
---|
841 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
842 | #include <libchip/ata.h> |
---|
843 | #endif |
---|
844 | |
---|
845 | #ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE |
---|
846 | |
---|
847 | #ifdef CONFIGURE_INIT |
---|
848 | rtems_driver_address_table Device_drivers[] = { |
---|
849 | #ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS |
---|
850 | CONFIGURE_BSP_PREREQUISITE_DRIVERS, |
---|
851 | #endif |
---|
852 | #ifdef CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS |
---|
853 | CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS, |
---|
854 | #endif |
---|
855 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
856 | CONSOLE_DRIVER_TABLE_ENTRY, |
---|
857 | #endif |
---|
858 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
859 | CLOCK_DRIVER_TABLE_ENTRY, |
---|
860 | #endif |
---|
861 | #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER |
---|
862 | RTC_DRIVER_TABLE_ENTRY, |
---|
863 | #endif |
---|
864 | #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER |
---|
865 | WATCHDOG_DRIVER_TABLE_ENTRY, |
---|
866 | #endif |
---|
867 | #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER |
---|
868 | DEVNULL_DRIVER_TABLE_ENTRY, |
---|
869 | #endif |
---|
870 | #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER |
---|
871 | IDE_CONTROLLER_DRIVER_TABLE_ENTRY, |
---|
872 | #endif |
---|
873 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
874 | ATA_DRIVER_TABLE_ENTRY, |
---|
875 | #endif |
---|
876 | #ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER |
---|
877 | FRAME_BUFFER_DRIVER_TABLE_ENTRY, |
---|
878 | #endif |
---|
879 | #ifdef CONFIGURE_APPLICATION_EXTRA_DRIVERS |
---|
880 | CONFIGURE_APPLICATION_EXTRA_DRIVERS, |
---|
881 | #endif |
---|
882 | #ifdef CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER |
---|
883 | NULL_DRIVER_TABLE_ENTRY |
---|
884 | #elif !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \ |
---|
885 | !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \ |
---|
886 | !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \ |
---|
887 | !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \ |
---|
888 | !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) && \ |
---|
889 | !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) && \ |
---|
890 | !defined(CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER) && \ |
---|
891 | !defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS) |
---|
892 | NULL_DRIVER_TABLE_ENTRY |
---|
893 | #endif |
---|
894 | }; |
---|
895 | #endif |
---|
896 | |
---|
897 | #endif /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */ |
---|
898 | |
---|
899 | /* |
---|
900 | * Default the number of drivers per node. This value may be |
---|
901 | * overridden by the user. |
---|
902 | */ |
---|
903 | |
---|
904 | #define CONFIGURE_NUMBER_OF_DRIVERS \ |
---|
905 | ((sizeof(Device_drivers) / sizeof(rtems_driver_address_table))) |
---|
906 | |
---|
907 | /** |
---|
908 | * This specifies the maximum number of device drivers that |
---|
909 | * can be installed in the system at one time. It must account |
---|
910 | * for both the statically and dynamically installed drivers. |
---|
911 | */ |
---|
912 | #ifndef CONFIGURE_MAXIMUM_DRIVERS |
---|
913 | #define CONFIGURE_MAXIMUM_DRIVERS CONFIGURE_NUMBER_OF_DRIVERS |
---|
914 | #endif |
---|
915 | |
---|
916 | |
---|
917 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
918 | /* |
---|
919 | * configure the priority of the ATA driver task |
---|
920 | */ |
---|
921 | #ifndef CONFIGURE_ATA_DRIVER_TASK_PRIORITY |
---|
922 | #define CONFIGURE_ATA_DRIVER_TASK_PRIORITY ATA_DRIVER_TASK_DEFAULT_PRIORITY |
---|
923 | #endif |
---|
924 | #ifdef CONFIGURE_INIT |
---|
925 | rtems_task_priority rtems_ata_driver_task_priority |
---|
926 | = CONFIGURE_ATA_DRIVER_TASK_PRIORITY; |
---|
927 | #endif /* CONFIGURE_INIT */ |
---|
928 | #endif |
---|
929 | |
---|
930 | /* |
---|
931 | * add bdbuf configuration and values for swapout task priority |
---|
932 | */ |
---|
933 | #ifdef CONFIGURE_APPLICATION_NEEDS_LIBBLOCK |
---|
934 | #include <rtems/bdbuf.h> |
---|
935 | /* |
---|
936 | * configure the bdbuf cache parameters |
---|
937 | */ |
---|
938 | #ifndef CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS |
---|
939 | #define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS \ |
---|
940 | RTEMS_BDBUF_MAX_READ_AHEAD_BLOCKS_DEFAULT |
---|
941 | #endif |
---|
942 | #ifndef CONFIGURE_BDBUF_MAX_WRITE_BLOCKS |
---|
943 | #define CONFIGURE_BDBUF_MAX_WRITE_BLOCKS \ |
---|
944 | RTEMS_BDBUF_MAX_WRITE_BLOCKS_DEFAULT |
---|
945 | #endif |
---|
946 | #ifndef CONFIGURE_SWAPOUT_TASK_PRIORITY |
---|
947 | #define CONFIGURE_SWAPOUT_TASK_PRIORITY \ |
---|
948 | RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT |
---|
949 | #endif |
---|
950 | #ifndef CONFIGURE_SWAPOUT_SWAP_PERIOD |
---|
951 | #define CONFIGURE_SWAPOUT_SWAP_PERIOD \ |
---|
952 | RTEMS_BDBUF_SWAPOUT_TASK_SWAP_PERIOD_DEFAULT |
---|
953 | #endif |
---|
954 | #ifndef CONFIGURE_SWAPOUT_BLOCK_HOLD |
---|
955 | #define CONFIGURE_SWAPOUT_BLOCK_HOLD \ |
---|
956 | RTEMS_BDBUF_SWAPOUT_TASK_BLOCK_HOLD_DEFAULT |
---|
957 | #endif |
---|
958 | #ifndef CONFIGURE_SWAPOUT_WORKER_TASKS |
---|
959 | #define CONFIGURE_SWAPOUT_WORKER_TASKS \ |
---|
960 | RTEMS_BDBUF_SWAPOUT_WORKER_TASKS_DEFAULT |
---|
961 | #endif |
---|
962 | #ifndef CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY |
---|
963 | #define CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY \ |
---|
964 | RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT |
---|
965 | #endif |
---|
966 | #ifndef CONFIGURE_BDBUF_CACHE_MEMORY_SIZE |
---|
967 | #define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE \ |
---|
968 | RTEMS_BDBUF_CACHE_MEMORY_SIZE_DEFAULT |
---|
969 | #endif |
---|
970 | #ifndef CONFIGURE_BDBUF_BUFFER_MIN_SIZE |
---|
971 | #define CONFIGURE_BDBUF_BUFFER_MIN_SIZE \ |
---|
972 | RTEMS_BDBUF_BUFFER_MIN_SIZE_DEFAULT |
---|
973 | #endif |
---|
974 | #ifndef CONFIGURE_BDBUF_BUFFER_MAX_SIZE |
---|
975 | #define CONFIGURE_BDBUF_BUFFER_MAX_SIZE \ |
---|
976 | RTEMS_BDBUF_BUFFER_MAX_SIZE_DEFAULT |
---|
977 | #endif |
---|
978 | #ifdef CONFIGURE_INIT |
---|
979 | const rtems_bdbuf_config rtems_bdbuf_configuration = { |
---|
980 | CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS, |
---|
981 | CONFIGURE_BDBUF_MAX_WRITE_BLOCKS, |
---|
982 | CONFIGURE_SWAPOUT_TASK_PRIORITY, |
---|
983 | CONFIGURE_SWAPOUT_SWAP_PERIOD, |
---|
984 | CONFIGURE_SWAPOUT_BLOCK_HOLD, |
---|
985 | CONFIGURE_SWAPOUT_WORKER_TASKS, |
---|
986 | CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY, |
---|
987 | CONFIGURE_BDBUF_CACHE_MEMORY_SIZE, |
---|
988 | CONFIGURE_BDBUF_BUFFER_MIN_SIZE, |
---|
989 | CONFIGURE_BDBUF_BUFFER_MAX_SIZE |
---|
990 | }; |
---|
991 | #endif |
---|
992 | |
---|
993 | /* |
---|
994 | * Semaphores: |
---|
995 | * o disk lock |
---|
996 | * o bdbuf lock |
---|
997 | * o bdbuf sync lock |
---|
998 | * o bdbuf access condition |
---|
999 | * o bdbuf transfer condition |
---|
1000 | * o bdbuf buffer condition |
---|
1001 | */ |
---|
1002 | #define CONFIGURE_LIBBLOCK_SEMAPHORES 6 |
---|
1003 | |
---|
1004 | #if defined(CONFIGURE_HAS_OWN_BDBUF_TABLE) || \ |
---|
1005 | defined(CONFIGURE_BDBUF_BUFFER_SIZE) || \ |
---|
1006 | defined(CONFIGURE_BDBUF_BUFFER_COUNT) |
---|
1007 | #error BDBUF Cache does not use a buffer configuration table. Please remove. |
---|
1008 | #endif |
---|
1009 | #else |
---|
1010 | #define CONFIGURE_LIBBLOCK_SEMAPHORES 0 |
---|
1011 | #endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */ |
---|
1012 | |
---|
1013 | #if defined(RTEMS_MULTIPROCESSING) |
---|
1014 | /* |
---|
1015 | * Default Multiprocessing Configuration Table. The defaults are |
---|
1016 | * appropriate for most of the RTEMS Multiprocessor Test Suite. Each |
---|
1017 | * value may be overridden within each test to customize the environment. |
---|
1018 | */ |
---|
1019 | |
---|
1020 | #ifdef CONFIGURE_MP_APPLICATION |
---|
1021 | #define CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER 1 |
---|
1022 | |
---|
1023 | #ifndef CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE |
---|
1024 | |
---|
1025 | #ifndef CONFIGURE_MP_NODE_NUMBER |
---|
1026 | #define CONFIGURE_MP_NODE_NUMBER NODE_NUMBER |
---|
1027 | #endif |
---|
1028 | |
---|
1029 | #ifndef CONFIGURE_MP_MAXIMUM_NODES |
---|
1030 | #define CONFIGURE_MP_MAXIMUM_NODES 2 |
---|
1031 | #endif |
---|
1032 | |
---|
1033 | #ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS |
---|
1034 | #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 32 |
---|
1035 | #endif |
---|
1036 | #define CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \ |
---|
1037 | _Configure_Object_RAM((_global_objects), sizeof(Objects_MP_Control)) |
---|
1038 | |
---|
1039 | #ifndef CONFIGURE_MP_MAXIMUM_PROXIES |
---|
1040 | #define CONFIGURE_MP_MAXIMUM_PROXIES 32 |
---|
1041 | #endif |
---|
1042 | #define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \ |
---|
1043 | _Configure_Object_RAM((_proxies) + 1, sizeof(Thread_Proxy_control) ) |
---|
1044 | |
---|
1045 | #ifndef CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK |
---|
1046 | #define CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK 0 |
---|
1047 | #endif |
---|
1048 | |
---|
1049 | #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER |
---|
1050 | #include <mpci.h> |
---|
1051 | #define CONFIGURE_MP_MPCI_TABLE_POINTER &MPCI_table |
---|
1052 | #endif |
---|
1053 | |
---|
1054 | #ifdef CONFIGURE_INIT |
---|
1055 | rtems_multiprocessing_table Multiprocessing_configuration = { |
---|
1056 | CONFIGURE_MP_NODE_NUMBER, /* local node number */ |
---|
1057 | CONFIGURE_MP_MAXIMUM_NODES, /* maximum # nodes */ |
---|
1058 | CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS, /* maximum # global objects */ |
---|
1059 | CONFIGURE_MP_MAXIMUM_PROXIES, /* maximum # proxies */ |
---|
1060 | CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK, /* MPCI stack > minimum */ |
---|
1061 | CONFIGURE_MP_MPCI_TABLE_POINTER /* ptr to MPCI config table */ |
---|
1062 | }; |
---|
1063 | #endif |
---|
1064 | |
---|
1065 | #define CONFIGURE_MULTIPROCESSING_TABLE &Multiprocessing_configuration |
---|
1066 | |
---|
1067 | #endif /* CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE */ |
---|
1068 | |
---|
1069 | #else |
---|
1070 | |
---|
1071 | #define CONFIGURE_MULTIPROCESSING_TABLE NULL |
---|
1072 | |
---|
1073 | #endif /* CONFIGURE_MP_APPLICATION */ |
---|
1074 | #endif /* RTEMS_MULTIPROCESSING */ |
---|
1075 | |
---|
1076 | #ifndef CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER |
---|
1077 | #define CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER 0 |
---|
1078 | #endif |
---|
1079 | |
---|
1080 | |
---|
1081 | /* |
---|
1082 | * Default Configuration Table. |
---|
1083 | */ |
---|
1084 | |
---|
1085 | #ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE |
---|
1086 | |
---|
1087 | #ifndef CONFIGURE_MAXIMUM_TASKS |
---|
1088 | #define CONFIGURE_MAXIMUM_TASKS 0 |
---|
1089 | #endif |
---|
1090 | |
---|
1091 | #ifndef CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS |
---|
1092 | #define CONFIGURE_NOTEPADS_ENABLED TRUE |
---|
1093 | #else |
---|
1094 | #define CONFIGURE_NOTEPADS_ENABLED FALSE |
---|
1095 | #endif |
---|
1096 | |
---|
1097 | #ifndef CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS |
---|
1098 | #define CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API \ |
---|
1099 | _Configure_From_workspace( sizeof(RTEMS_API_Control) ) |
---|
1100 | #else |
---|
1101 | #define CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API \ |
---|
1102 | _Configure_From_workspace( sizeof(RTEMS_API_Control) - \ |
---|
1103 | (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t))) |
---|
1104 | #endif |
---|
1105 | |
---|
1106 | /** |
---|
1107 | * This macro calculates the memory required for task variables. |
---|
1108 | * |
---|
1109 | * @note Each task variable is individually allocated from the Workspace. |
---|
1110 | * Hence, we do the multiplication on the configured size. |
---|
1111 | */ |
---|
1112 | #ifndef CONFIGURE_MAXIMUM_TASK_VARIABLES |
---|
1113 | #define CONFIGURE_MAXIMUM_TASK_VARIABLES 0 |
---|
1114 | #define CONFIGURE_MEMORY_FOR_TASK_VARIABLES(_task_variables) 0 |
---|
1115 | #else |
---|
1116 | #define CONFIGURE_MEMORY_FOR_TASK_VARIABLES(_task_variables) \ |
---|
1117 | (_task_variables) * \ |
---|
1118 | _Configure_From_workspace(sizeof(rtems_task_variable_t)) |
---|
1119 | #endif |
---|
1120 | |
---|
1121 | #ifndef CONFIGURE_MAXIMUM_TIMERS |
---|
1122 | #define CONFIGURE_MAXIMUM_TIMERS 0 |
---|
1123 | #define CONFIGURE_MEMORY_FOR_TIMERS(_timers) 0 |
---|
1124 | #else |
---|
1125 | #define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \ |
---|
1126 | _Configure_Object_RAM(_timers, sizeof(Timer_Control) ) |
---|
1127 | #endif |
---|
1128 | |
---|
1129 | #ifndef CONFIGURE_MAXIMUM_SEMAPHORES |
---|
1130 | #define CONFIGURE_MAXIMUM_SEMAPHORES 0 |
---|
1131 | #endif |
---|
1132 | |
---|
1133 | #define CONFIGURE_SEMAPHORES \ |
---|
1134 | (CONFIGURE_MAXIMUM_SEMAPHORES + CONFIGURE_LIBIO_SEMAPHORES + \ |
---|
1135 | CONFIGURE_TERMIOS_SEMAPHORES + CONFIGURE_LIBBLOCK_SEMAPHORES) |
---|
1136 | |
---|
1137 | /* |
---|
1138 | * If there are no user or support semaphores defined, then we can assume |
---|
1139 | * that no memory need be allocated at all for semaphores. |
---|
1140 | */ |
---|
1141 | #if CONFIGURE_SEMAPHORES == 0 |
---|
1142 | #define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) 0 |
---|
1143 | #else |
---|
1144 | #define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \ |
---|
1145 | _Configure_Object_RAM(_semaphores, sizeof(Semaphore_Control) ) |
---|
1146 | #endif |
---|
1147 | |
---|
1148 | #ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES |
---|
1149 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 0 |
---|
1150 | #define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) 0 |
---|
1151 | #else |
---|
1152 | #define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \ |
---|
1153 | _Configure_Object_RAM(_queues, sizeof(Message_queue_Control) ) |
---|
1154 | #endif |
---|
1155 | |
---|
1156 | #ifndef CONFIGURE_MAXIMUM_PARTITIONS |
---|
1157 | #define CONFIGURE_MAXIMUM_PARTITIONS 0 |
---|
1158 | #define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) 0 |
---|
1159 | #else |
---|
1160 | #define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \ |
---|
1161 | _Configure_Object_RAM(_partitions, sizeof(Partition_Control) ) |
---|
1162 | #endif |
---|
1163 | |
---|
1164 | #ifndef CONFIGURE_MAXIMUM_REGIONS |
---|
1165 | #define CONFIGURE_MAXIMUM_REGIONS 0 |
---|
1166 | #define CONFIGURE_MEMORY_FOR_REGIONS(_regions) 0 |
---|
1167 | #else |
---|
1168 | #define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \ |
---|
1169 | _Configure_Object_RAM(_regions, sizeof(Region_Control) ) |
---|
1170 | #endif |
---|
1171 | |
---|
1172 | #ifndef CONFIGURE_MAXIMUM_PORTS |
---|
1173 | #define CONFIGURE_MAXIMUM_PORTS 0 |
---|
1174 | #define CONFIGURE_MEMORY_FOR_PORTS(_ports) 0 |
---|
1175 | #else |
---|
1176 | #define CONFIGURE_MEMORY_FOR_PORTS(_ports) \ |
---|
1177 | _Configure_Object_RAM(_ports, sizeof(Dual_ported_memory_Control) ) |
---|
1178 | #endif |
---|
1179 | |
---|
1180 | #ifndef CONFIGURE_MAXIMUM_PERIODS |
---|
1181 | #define CONFIGURE_MAXIMUM_PERIODS 0 |
---|
1182 | #define CONFIGURE_MEMORY_FOR_PERIODS(_periods) 0 |
---|
1183 | #else |
---|
1184 | #define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \ |
---|
1185 | _Configure_Object_RAM(_periods, sizeof(Rate_monotonic_Control) ) |
---|
1186 | #endif |
---|
1187 | |
---|
1188 | #ifndef CONFIGURE_MAXIMUM_BARRIERS |
---|
1189 | #define CONFIGURE_MAXIMUM_BARRIERS 0 |
---|
1190 | #define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) 0 |
---|
1191 | #else |
---|
1192 | #define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) \ |
---|
1193 | _Configure_Object_RAM(_barriers, sizeof(Barrier_Control) ) |
---|
1194 | #endif |
---|
1195 | |
---|
1196 | #ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS |
---|
1197 | #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0 |
---|
1198 | #define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) 0 |
---|
1199 | #else |
---|
1200 | #define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \ |
---|
1201 | _Configure_Object_RAM(_extensions, sizeof(Extension_Control) ) |
---|
1202 | #endif |
---|
1203 | |
---|
1204 | #ifndef CONFIGURE_MICROSECONDS_PER_TICK |
---|
1205 | #define CONFIGURE_MICROSECONDS_PER_TICK \ |
---|
1206 | RTEMS_MILLISECONDS_TO_MICROSECONDS(10) |
---|
1207 | #endif |
---|
1208 | |
---|
1209 | #ifndef CONFIGURE_TICKS_PER_TIMESLICE |
---|
1210 | #define CONFIGURE_TICKS_PER_TIMESLICE 50 |
---|
1211 | #endif |
---|
1212 | |
---|
1213 | /* |
---|
1214 | * Initial Extension Set |
---|
1215 | */ |
---|
1216 | |
---|
1217 | #ifdef CONFIGURE_INIT |
---|
1218 | #ifdef CONFIGURE_STACK_CHECKER_ENABLED |
---|
1219 | #include <rtems/stackchk.h> |
---|
1220 | #endif |
---|
1221 | #include <rtems/libcsupport.h> |
---|
1222 | |
---|
1223 | #if defined(CONFIGURE_INITIAL_EXTENSIONS) || \ |
---|
1224 | defined(CONFIGURE_STACK_CHECKER_ENABLED) || \ |
---|
1225 | (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) |
---|
1226 | rtems_extensions_table Configuration_Initial_Extensions[] = { |
---|
1227 | #if !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY) |
---|
1228 | RTEMS_NEWLIB_EXTENSION, |
---|
1229 | #endif |
---|
1230 | #if defined(CONFIGURE_STACK_CHECKER_ENABLED) |
---|
1231 | RTEMS_STACK_CHECKER_EXTENSION, |
---|
1232 | #endif |
---|
1233 | #if defined(CONFIGURE_INITIAL_EXTENSIONS) |
---|
1234 | CONFIGURE_INITIAL_EXTENSIONS, |
---|
1235 | #endif |
---|
1236 | }; |
---|
1237 | |
---|
1238 | #define CONFIGURE_INITIAL_EXTENSION_TABLE Configuration_Initial_Extensions |
---|
1239 | #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \ |
---|
1240 | ((sizeof(Configuration_Initial_Extensions) / \ |
---|
1241 | sizeof(rtems_extensions_table))) |
---|
1242 | #else |
---|
1243 | #define CONFIGURE_INITIAL_EXTENSION_TABLE NULL |
---|
1244 | #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS 0 |
---|
1245 | #endif |
---|
1246 | |
---|
1247 | |
---|
1248 | #endif |
---|
1249 | |
---|
1250 | /* |
---|
1251 | * POSIX API Configuration Parameters |
---|
1252 | */ |
---|
1253 | |
---|
1254 | #ifdef RTEMS_POSIX_API |
---|
1255 | |
---|
1256 | #include <sys/types.h> |
---|
1257 | #include <signal.h> |
---|
1258 | #include <limits.h> |
---|
1259 | #include <mqueue.h> |
---|
1260 | #include <rtems/posix/barrier.h> |
---|
1261 | #include <rtems/posix/cond.h> |
---|
1262 | #include <rtems/posix/mqueue.h> |
---|
1263 | #include <rtems/posix/mutex.h> |
---|
1264 | #include <rtems/posix/key.h> |
---|
1265 | #include <rtems/posix/psignal.h> |
---|
1266 | #include <rtems/posix/rwlock.h> |
---|
1267 | #include <rtems/posix/semaphore.h> |
---|
1268 | #include <rtems/posix/spinlock.h> |
---|
1269 | #include <rtems/posix/threadsup.h> |
---|
1270 | #include <rtems/posix/timer.h> |
---|
1271 | |
---|
1272 | /** |
---|
1273 | * Account for the object control structures plus the name |
---|
1274 | * of the object to be duplicated. |
---|
1275 | */ |
---|
1276 | #define _Configure_POSIX_Named_Object_RAM(_number, _size) \ |
---|
1277 | _Configure_Object_RAM( (_number), _size ) + \ |
---|
1278 | ((_number) + _Configure_From_workspace(NAME_MAX) ) |
---|
1279 | |
---|
1280 | #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS |
---|
1281 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 0 |
---|
1282 | #endif |
---|
1283 | |
---|
1284 | #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \ |
---|
1285 | _Configure_From_workspace( \ |
---|
1286 | sizeof (POSIX_API_Control) + \ |
---|
1287 | (sizeof (void *) * (CONFIGURE_MAXIMUM_POSIX_KEYS)) \ |
---|
1288 | ) |
---|
1289 | |
---|
1290 | #ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES |
---|
1291 | #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 0 |
---|
1292 | #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) 0 |
---|
1293 | #else |
---|
1294 | #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \ |
---|
1295 | _Configure_Object_RAM(_mutexes, sizeof(POSIX_Mutex_Control) ) |
---|
1296 | #endif |
---|
1297 | |
---|
1298 | #ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES |
---|
1299 | #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 0 |
---|
1300 | #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condvars) 0 |
---|
1301 | #else |
---|
1302 | #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condvars) \ |
---|
1303 | _Configure_Object_RAM(_condvars, \ |
---|
1304 | sizeof(POSIX_Condition_variables_Control) ) |
---|
1305 | #endif |
---|
1306 | |
---|
1307 | #ifndef CONFIGURE_MAXIMUM_POSIX_KEYS |
---|
1308 | #define CONFIGURE_MAXIMUM_POSIX_KEYS 0 |
---|
1309 | #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) 0 |
---|
1310 | #else |
---|
1311 | #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) \ |
---|
1312 | _Configure_Object_RAM(_keys, sizeof(POSIX_Keys_Control) ) |
---|
1313 | #endif |
---|
1314 | |
---|
1315 | #ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS |
---|
1316 | #define CONFIGURE_MAXIMUM_POSIX_TIMERS 0 |
---|
1317 | #define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) 0 |
---|
1318 | #else |
---|
1319 | #define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \ |
---|
1320 | _Configure_Object_RAM(_timers, sizeof(POSIX_Timer_Control) ) |
---|
1321 | #endif |
---|
1322 | |
---|
1323 | #ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS |
---|
1324 | #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0 |
---|
1325 | #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) 0 |
---|
1326 | #else |
---|
1327 | #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \ |
---|
1328 | _Configure_From_workspace( \ |
---|
1329 | (_queued_signals) * (sizeof(POSIX_signals_Siginfo_node)) ) |
---|
1330 | #endif |
---|
1331 | |
---|
1332 | #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES |
---|
1333 | #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 0 |
---|
1334 | #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) 0 |
---|
1335 | #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS 0 |
---|
1336 | #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS(_fds) 0 |
---|
1337 | #else |
---|
1338 | #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \ |
---|
1339 | _Configure_POSIX_Named_Object_RAM( \ |
---|
1340 | _message_queues, sizeof(POSIX_Message_queue_Control) ) |
---|
1341 | |
---|
1342 | /* default to same number */ |
---|
1343 | #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS |
---|
1344 | #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS \ |
---|
1345 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES |
---|
1346 | #endif |
---|
1347 | |
---|
1348 | #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS(_mqueue_fds) \ |
---|
1349 | _Configure_POSIX_Named_Object_RAM( \ |
---|
1350 | _mqueue_fds, sizeof(POSIX_Message_queue_Control_fd) ) |
---|
1351 | #endif |
---|
1352 | |
---|
1353 | #ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES |
---|
1354 | #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0 |
---|
1355 | #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) 0 |
---|
1356 | #else |
---|
1357 | #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \ |
---|
1358 | _Configure_POSIX_Named_Object_RAM( \ |
---|
1359 | _semaphores, sizeof(POSIX_Semaphore_Control) ) |
---|
1360 | #endif |
---|
1361 | |
---|
1362 | #ifndef CONFIGURE_MAXIMUM_POSIX_BARRIERS |
---|
1363 | #define CONFIGURE_MAXIMUM_POSIX_BARRIERS 0 |
---|
1364 | #define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) 0 |
---|
1365 | #else |
---|
1366 | #define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) \ |
---|
1367 | _Configure_Object_RAM(_barriers, sizeof(POSIX_Barrier_Control) ) |
---|
1368 | #endif |
---|
1369 | |
---|
1370 | #ifndef CONFIGURE_MAXIMUM_POSIX_SPINLOCKS |
---|
1371 | #define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS 0 |
---|
1372 | #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) 0 |
---|
1373 | #else |
---|
1374 | #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) \ |
---|
1375 | _Configure_Object_RAM(_spinlocks, sizeof(POSIX_Spinlock_Control) ) |
---|
1376 | #endif |
---|
1377 | |
---|
1378 | #ifndef CONFIGURE_MAXIMUM_POSIX_RWLOCKS |
---|
1379 | #define CONFIGURE_MAXIMUM_POSIX_RWLOCKS 0 |
---|
1380 | #define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) 0 |
---|
1381 | #else |
---|
1382 | #define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) \ |
---|
1383 | _Configure_Object_RAM(_rwlocks, sizeof(POSIX_RWLock_Control) ) |
---|
1384 | #endif |
---|
1385 | |
---|
1386 | #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE |
---|
1387 | |
---|
1388 | #ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE |
---|
1389 | |
---|
1390 | /* |
---|
1391 | * The user is defining their own table information and setting the |
---|
1392 | * appropriate variables for the POSIX Initialization Thread Table. |
---|
1393 | */ |
---|
1394 | |
---|
1395 | #else |
---|
1396 | |
---|
1397 | #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT |
---|
1398 | #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT POSIX_Init |
---|
1399 | #endif |
---|
1400 | |
---|
1401 | #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE |
---|
1402 | #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \ |
---|
1403 | (CONFIGURE_MINIMUM_TASK_STACK_SIZE * 2) |
---|
1404 | #endif |
---|
1405 | |
---|
1406 | #ifdef CONFIGURE_INIT |
---|
1407 | posix_initialization_threads_table POSIX_Initialization_threads[] = { |
---|
1408 | { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT, \ |
---|
1409 | CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE } |
---|
1410 | }; |
---|
1411 | #endif |
---|
1412 | |
---|
1413 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME \ |
---|
1414 | POSIX_Initialization_threads |
---|
1415 | |
---|
1416 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \ |
---|
1417 | sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \ |
---|
1418 | sizeof(posix_initialization_threads_table) |
---|
1419 | |
---|
1420 | #endif /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */ |
---|
1421 | |
---|
1422 | #else /* CONFIGURE_POSIX_INIT_THREAD_TABLE */ |
---|
1423 | |
---|
1424 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL |
---|
1425 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0 |
---|
1426 | |
---|
1427 | #endif |
---|
1428 | |
---|
1429 | #define CONFIGURE_MEMORY_FOR_POSIX \ |
---|
1430 | ( CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ) + \ |
---|
1431 | CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \ |
---|
1432 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ) + \ |
---|
1433 | CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ) + \ |
---|
1434 | CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \ |
---|
1435 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) + \ |
---|
1436 | CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \ |
---|
1437 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ) + \ |
---|
1438 | CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS( \ |
---|
1439 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS ) + \ |
---|
1440 | CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \ |
---|
1441 | CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ) + \ |
---|
1442 | CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(CONFIGURE_MAXIMUM_POSIX_BARRIERS) + \ |
---|
1443 | CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( \ |
---|
1444 | CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ) + \ |
---|
1445 | CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( \ |
---|
1446 | CONFIGURE_MAXIMUM_POSIX_RWLOCKS ) + \ |
---|
1447 | CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ) + \ |
---|
1448 | (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE) \ |
---|
1449 | ) |
---|
1450 | #else |
---|
1451 | |
---|
1452 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 0 |
---|
1453 | #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API 0 |
---|
1454 | #define CONFIGURE_MEMORY_FOR_POSIX 0 |
---|
1455 | |
---|
1456 | #endif /* RTEMS_POSIX_API */ |
---|
1457 | |
---|
1458 | #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE |
---|
1459 | #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE 0 |
---|
1460 | #endif |
---|
1461 | |
---|
1462 | /* |
---|
1463 | * This block of defines are for applications which use GNAT/RTEMS. |
---|
1464 | * GNAT implements each Ada task as a POSIX thread. |
---|
1465 | */ |
---|
1466 | #ifdef CONFIGURE_GNAT_RTEMS |
---|
1467 | |
---|
1468 | /** |
---|
1469 | * The GNAT run-time needs something less than (10) POSIX mutexes. |
---|
1470 | * We may be able to get by with less but why bother. |
---|
1471 | */ |
---|
1472 | #define CONFIGURE_GNAT_MUTEXES 10 |
---|
1473 | |
---|
1474 | /** |
---|
1475 | * This is the maximum number of Ada tasks which can be concurrently |
---|
1476 | * in existence. Twenty (20) are required to run all tests in the |
---|
1477 | * ACATS (formerly ACVC). |
---|
1478 | */ |
---|
1479 | #ifndef CONFIGURE_MAXIMUM_ADA_TASKS |
---|
1480 | #define CONFIGURE_MAXIMUM_ADA_TASKS 20 |
---|
1481 | #endif |
---|
1482 | |
---|
1483 | /** |
---|
1484 | * This is the number of non-Ada tasks which invoked Ada code. |
---|
1485 | */ |
---|
1486 | #ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS |
---|
1487 | #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 |
---|
1488 | #endif |
---|
1489 | |
---|
1490 | /** |
---|
1491 | * Ada tasks are allocated twice the minimum stack space. |
---|
1492 | */ |
---|
1493 | #define CONFIGURE_ADA_TASKS_STACK \ |
---|
1494 | (CONFIGURE_MAXIMUM_ADA_TASKS * \ |
---|
1495 | (CONFIGURE_MINIMUM_TASK_STACK_SIZE + (6 * 1024))) |
---|
1496 | |
---|
1497 | #else |
---|
1498 | #define CONFIGURE_GNAT_MUTEXES 0 |
---|
1499 | #define CONFIGURE_MAXIMUM_ADA_TASKS 0 |
---|
1500 | #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 |
---|
1501 | #define CONFIGURE_ADA_TASKS_STACK 0 |
---|
1502 | #endif |
---|
1503 | |
---|
1504 | /** |
---|
1505 | * This macro specifies the amount of memory to be reserved for the |
---|
1506 | * Newlib C Library reentrancy structure -- if we are using newlib. |
---|
1507 | */ |
---|
1508 | |
---|
1509 | #if (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) |
---|
1510 | #include <reent.h> |
---|
1511 | |
---|
1512 | #define CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB \ |
---|
1513 | _Configure_From_workspace(sizeof(struct _reent)) |
---|
1514 | #else |
---|
1515 | #define CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB 0 |
---|
1516 | #endif |
---|
1517 | |
---|
1518 | /* |
---|
1519 | * Calculate the RAM size based on the maximum number of objects configured. |
---|
1520 | */ |
---|
1521 | |
---|
1522 | #ifndef CONFIGURE_EXECUTIVE_RAM_SIZE |
---|
1523 | |
---|
1524 | /** |
---|
1525 | * Account for allocating the following per object |
---|
1526 | * + array of object control structures |
---|
1527 | * + local pointer table -- pointer per object plus a zero'th |
---|
1528 | * entry in the local pointer table. |
---|
1529 | */ |
---|
1530 | |
---|
1531 | #define CONFIGURE_MEMORY_FOR_TASKS(_tasks, _number_FP_tasks) \ |
---|
1532 | ( \ |
---|
1533 | _Configure_Object_RAM(_tasks, sizeof(Thread_Control)) + \ |
---|
1534 | (_Configure_Max_Objects(_tasks) * \ |
---|
1535 | (_Configure_From_workspace(CONFIGURE_MINIMUM_TASK_STACK_SIZE) + \ |
---|
1536 | CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API + \ |
---|
1537 | CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB + \ |
---|
1538 | CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API)) + \ |
---|
1539 | _Configure_From_workspace( \ |
---|
1540 | _Configure_Max_Objects(_number_FP_tasks) * CONTEXT_FP_SIZE) + \ |
---|
1541 | _Configure_From_workspace( \ |
---|
1542 | (CONFIGURE_MAXIMUM_USER_EXTENSIONS + 1) * sizeof(void *)) \ |
---|
1543 | ) |
---|
1544 | |
---|
1545 | /** |
---|
1546 | * This defines the amount of memory configured for the multiprocessing |
---|
1547 | * support required by this application. |
---|
1548 | */ |
---|
1549 | #ifdef CONFIGURE_MP_APPLICATION |
---|
1550 | #define CONFIGURE_MEMORY_FOR_MP \ |
---|
1551 | (CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \ |
---|
1552 | CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS( \ |
---|
1553 | CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) + \ |
---|
1554 | CONFIGURE_MEMORY_FOR_TASKS(1, 1) + \ |
---|
1555 | CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK \ |
---|
1556 | ) |
---|
1557 | #else |
---|
1558 | #define CONFIGURE_MEMORY_FOR_MP 0 |
---|
1559 | #endif |
---|
1560 | |
---|
1561 | /** |
---|
1562 | * This is so we can account for tasks with stacks greater than minimum |
---|
1563 | * size. This is in bytes. |
---|
1564 | */ |
---|
1565 | #ifndef CONFIGURE_EXTRA_TASK_STACKS |
---|
1566 | #define CONFIGURE_EXTRA_TASK_STACKS 0 |
---|
1567 | #endif |
---|
1568 | |
---|
1569 | /** |
---|
1570 | * The following macro is used to calculate the memory allocated by RTEMS |
---|
1571 | * for the message buffers associated with a particular message queue. |
---|
1572 | * There is a fixed amount of overhead per message. |
---|
1573 | */ |
---|
1574 | #define CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(_messages, _size) \ |
---|
1575 | _Configure_From_workspace( \ |
---|
1576 | (_messages) * ((_size) + sizeof(CORE_message_queue_Buffer_control))) |
---|
1577 | |
---|
1578 | /** |
---|
1579 | * This macros is set to the amount of memory required for pending message |
---|
1580 | * buffers in bytes. It should be constructed by adding together a |
---|
1581 | * set of values determined by CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE. |
---|
1582 | */ |
---|
1583 | #ifndef CONFIGURE_MESSAGE_BUFFER_MEMORY |
---|
1584 | #define CONFIGURE_MESSAGE_BUFFER_MEMORY 0 |
---|
1585 | #endif |
---|
1586 | |
---|
1587 | /** |
---|
1588 | * This macro is available just in case the confdefs.h file underallocates |
---|
1589 | * memory for a particular application. This lets the user add some extra |
---|
1590 | * memory in case something broken and underestimates. |
---|
1591 | * |
---|
1592 | * It is also possible for cases where confdefs.h overallocates memory, |
---|
1593 | * you could substract memory from the allocated. The estimate is just |
---|
1594 | * that, an estimate, and assumes worst case alignment and padding on |
---|
1595 | * each allocated element. So in some cases it could be too conservative. |
---|
1596 | * |
---|
1597 | * @note Historically this was used for message buffers. |
---|
1598 | */ |
---|
1599 | #ifndef CONFIGURE_MEMORY_OVERHEAD |
---|
1600 | #define CONFIGURE_MEMORY_OVERHEAD 0 |
---|
1601 | #endif |
---|
1602 | |
---|
1603 | /** |
---|
1604 | * On architectures that use Simple Vectored Interrupts, it is RTEMS |
---|
1605 | * responsibility to allocate the vector table. This avoids reserving |
---|
1606 | * the memory on architectures that use the Programmable Interrupt |
---|
1607 | * Controller Vectored Interrupts. |
---|
1608 | */ |
---|
1609 | #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) |
---|
1610 | /* |
---|
1611 | * This is a (hopefully) temporary hack. On the mips, the number of |
---|
1612 | * vectors is NOT statically defined. But it has to be statically |
---|
1613 | * defined for this to work. This is an issue looking for a nice |
---|
1614 | * solution. |
---|
1615 | */ |
---|
1616 | #if defined(__mips__) |
---|
1617 | #define CONFIGURE_INTERRUPT_VECTOR_TABLE \ |
---|
1618 | _Configure_From_workspace( (sizeof(ISR_Handler_entry) * 256)) |
---|
1619 | #else |
---|
1620 | #define CONFIGURE_INTERRUPT_VECTOR_TABLE \ |
---|
1621 | _Configure_From_workspace( \ |
---|
1622 | (sizeof(ISR_Handler_entry) * ISR_NUMBER_OF_VECTORS)) |
---|
1623 | #endif |
---|
1624 | #else |
---|
1625 | #define CONFIGURE_INTERRUPT_VECTOR_TABLE 0 |
---|
1626 | #endif |
---|
1627 | |
---|
1628 | /** |
---|
1629 | * RTEMS uses one instance of an internal mutex class. This accounts |
---|
1630 | * for that mutex |
---|
1631 | */ |
---|
1632 | #define CONFIGURE_API_MUTEX_MEMORY \ |
---|
1633 | _Configure_Object_RAM(1, sizeof(API_Mutex_Control)) |
---|
1634 | |
---|
1635 | /** |
---|
1636 | * This defines the memory used by the thread ready chains. There is |
---|
1637 | * one chain per priority. |
---|
1638 | */ |
---|
1639 | #define CONFIGURE_MEMORY_FOR_THREAD_READY_CHAINS \ |
---|
1640 | _Configure_From_workspace( \ |
---|
1641 | ((CONFIGURE_MAXIMUM_PRIORITY+1) * sizeof(Chain_Control)) ) |
---|
1642 | /** |
---|
1643 | * This defines the amount of memory reserved for the IDLE task |
---|
1644 | * control structures and stack. |
---|
1645 | */ |
---|
1646 | #define CONFIGURE_MEMORY_FOR_IDLE_TASK \ |
---|
1647 | (CONFIGURE_MEMORY_FOR_TASKS(1, 0) + \ |
---|
1648 | (CONFIGURE_IDLE_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)) |
---|
1649 | |
---|
1650 | /** |
---|
1651 | * This macro accounts for general RTEMS system overhead. |
---|
1652 | */ |
---|
1653 | #define CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \ |
---|
1654 | ( CONFIGURE_MEMORY_FOR_IDLE_TASK + /* IDLE and stack */ \ |
---|
1655 | CONFIGURE_MEMORY_FOR_THREAD_READY_CHAINS + /* Ready chains */ \ |
---|
1656 | CONFIGURE_INTERRUPT_VECTOR_TABLE + /* interrupt vectors */ \ |
---|
1657 | CONFIGURE_INTERRUPT_STACK_MEMORY + /* interrupt stack */ \ |
---|
1658 | CONFIGURE_API_MUTEX_MEMORY /* allocation mutex */ \ |
---|
1659 | ) |
---|
1660 | |
---|
1661 | /* |
---|
1662 | * Now account for any extra memory that initialization tasks or threads |
---|
1663 | * may have requested. |
---|
1664 | */ |
---|
1665 | |
---|
1666 | /** |
---|
1667 | * This accounts for any extra memory required by the Classic API |
---|
1668 | * Initialization Task. |
---|
1669 | */ |
---|
1670 | #if (CONFIGURE_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
1671 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART \ |
---|
1672 | (CONFIGURE_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
1673 | #else |
---|
1674 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART 0 |
---|
1675 | #endif |
---|
1676 | |
---|
1677 | /** |
---|
1678 | * This accounts for any extra memory required by the POSIX API |
---|
1679 | * Initialization Thread. |
---|
1680 | */ |
---|
1681 | #if defined(RTEMS_POSIX_API) && \ |
---|
1682 | (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
1683 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART \ |
---|
1684 | (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
1685 | #else |
---|
1686 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART 0 |
---|
1687 | #endif |
---|
1688 | |
---|
1689 | /** |
---|
1690 | * This macro provides a summation of the various initialization task |
---|
1691 | * and thread stack requirements. |
---|
1692 | */ |
---|
1693 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS \ |
---|
1694 | (CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART + \ |
---|
1695 | CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART) |
---|
1696 | |
---|
1697 | /** |
---|
1698 | * This macro provides a summation of the various task and thread |
---|
1699 | * requirements. |
---|
1700 | */ |
---|
1701 | #define CONFIGURE_TOTAL_TASKS_AND_THREADS \ |
---|
1702 | (CONFIGURE_MAXIMUM_TASKS + \ |
---|
1703 | CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS) |
---|
1704 | |
---|
1705 | /** |
---|
1706 | * This macro reserves the memory required by the statically configured |
---|
1707 | * user extensions. |
---|
1708 | */ |
---|
1709 | #define CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS \ |
---|
1710 | ((CONFIGURE_NEWLIB_EXTENSION * \ |
---|
1711 | _Configure_From_workspace( sizeof(User_extensions_Control))) + \ |
---|
1712 | (CONFIGURE_STACK_CHECKER_EXTENSION * \ |
---|
1713 | _Configure_From_workspace( sizeof(User_extensions_Control))) \ |
---|
1714 | ) |
---|
1715 | |
---|
1716 | /** |
---|
1717 | * This macro provides a summation of the memory required by the |
---|
1718 | * Classic API as configured. |
---|
1719 | */ |
---|
1720 | #define CONFIGURE_MEMORY_FOR_CLASSIC \ |
---|
1721 | (CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES) + \ |
---|
1722 | CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS + \ |
---|
1723 | CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER ) + \ |
---|
1724 | CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_SEMAPHORES) + \ |
---|
1725 | CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \ |
---|
1726 | CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \ |
---|
1727 | CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ) + \ |
---|
1728 | CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \ |
---|
1729 | CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \ |
---|
1730 | CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_MAXIMUM_BARRIERS) + \ |
---|
1731 | CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS) \ |
---|
1732 | ) |
---|
1733 | |
---|
1734 | #if defined(CONFIGURE_CONFDEFS_DEBUG) && defined(CONFIGURE_INIT) |
---|
1735 | /** |
---|
1736 | * This is a debug mechanism, so if you need to, the executable will |
---|
1737 | * have a structure with various partial values. Add to this as you |
---|
1738 | * need to. Viewing this structure in gdb combined with dumping |
---|
1739 | * the Configuration structures generated should help a lot in tracing |
---|
1740 | * down errors and analyzing where over and under allocations are. |
---|
1741 | */ |
---|
1742 | typedef struct { |
---|
1743 | uint32_t SYSTEM_OVERHEAD; |
---|
1744 | uint32_t STATIC_EXTENSIONS; |
---|
1745 | uint32_t INITIALIZATION_THREADS_STACKS; |
---|
1746 | |
---|
1747 | uint32_t PER_INTEGER_TASK; |
---|
1748 | uint32_t FP_OVERHEAD; |
---|
1749 | uint32_t CLASSIC; |
---|
1750 | uint32_t POSIX; |
---|
1751 | |
---|
1752 | /* System overhead pieces */ |
---|
1753 | uint32_t INTERRUPT_VECTOR_TABLE; |
---|
1754 | uint32_t INTERRUPT_STACK_MEMORY; |
---|
1755 | uint32_t THREAD_READY_CHAINS; |
---|
1756 | uint32_t MEMORY_FOR_IDLE_TASK; |
---|
1757 | |
---|
1758 | /* Classic API Pieces */ |
---|
1759 | uint32_t CLASSIC_TASKS; |
---|
1760 | uint32_t TASK_VARIABLES; |
---|
1761 | uint32_t TIMERS; |
---|
1762 | uint32_t SEMAPHORES; |
---|
1763 | uint32_t MESSAGE_QUEUES; |
---|
1764 | uint32_t PARTITIONS; |
---|
1765 | uint32_t REGIONS; |
---|
1766 | uint32_t PORTS; |
---|
1767 | uint32_t PERIODS; |
---|
1768 | uint32_t BARRIERS; |
---|
1769 | uint32_t USER_EXTENSIONS; |
---|
1770 | #ifdef RTEMS_POSIX_API |
---|
1771 | /* POSIX API Pieces */ |
---|
1772 | uint32_t POSIX_MUTEXES; |
---|
1773 | uint32_t POSIX_CONDITION_VARIABLES; |
---|
1774 | uint32_t POSIX_KEYS; |
---|
1775 | uint32_t POSIX_TIMERS; |
---|
1776 | uint32_t POSIX_QUEUED_SIGNALS; |
---|
1777 | uint32_t POSIX_MESSAGE_QUEUES; |
---|
1778 | uint32_t POSIX_SEMAPHORES; |
---|
1779 | uint32_t POSIX_BARRIERS; |
---|
1780 | uint32_t POSIX_SPINLOCKS; |
---|
1781 | uint32_t POSIX_RWLOCKS; |
---|
1782 | #endif |
---|
1783 | } Configuration_Debug_t; |
---|
1784 | |
---|
1785 | Configuration_Debug_t Configuration_Memory_Debug = { |
---|
1786 | /* General Information */ |
---|
1787 | CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD, |
---|
1788 | CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS, |
---|
1789 | CONFIGURE_INITIALIZATION_THREADS_STACKS, |
---|
1790 | CONFIGURE_MEMORY_FOR_TASKS(1, 0), |
---|
1791 | CONFIGURE_MEMORY_FOR_TASKS(0, 1), |
---|
1792 | CONFIGURE_MEMORY_FOR_CLASSIC, |
---|
1793 | CONFIGURE_MEMORY_FOR_POSIX, |
---|
1794 | |
---|
1795 | /* System overhead pieces */ |
---|
1796 | CONFIGURE_INTERRUPT_VECTOR_TABLE, |
---|
1797 | CONFIGURE_INTERRUPT_STACK_MEMORY, |
---|
1798 | CONFIGURE_MEMORY_FOR_THREAD_READY_CHAINS, |
---|
1799 | CONFIGURE_MEMORY_FOR_IDLE_TASK, |
---|
1800 | |
---|
1801 | /* Classic API Pieces */ |
---|
1802 | CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS, 0), |
---|
1803 | CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES), |
---|
1804 | CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS), |
---|
1805 | CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_SEMAPHORES), |
---|
1806 | CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES), |
---|
1807 | CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS), |
---|
1808 | CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ), |
---|
1809 | CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS), |
---|
1810 | CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS), |
---|
1811 | CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_MAXIMUM_BARRIERS), |
---|
1812 | CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS), |
---|
1813 | |
---|
1814 | #ifdef RTEMS_POSIX_API |
---|
1815 | /* POSIX API Pieces */ |
---|
1816 | CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ), |
---|
1817 | CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( |
---|
1818 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ), |
---|
1819 | CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ), |
---|
1820 | CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( |
---|
1821 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ), |
---|
1822 | CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( |
---|
1823 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ), |
---|
1824 | CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ), |
---|
1825 | CONFIGURE_MEMORY_FOR_POSIX_BARRIERS( CONFIGURE_MAXIMUM_POSIX_BARRIERS ), |
---|
1826 | CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ), |
---|
1827 | CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( CONFIGURE_MAXIMUM_POSIX_RWLOCKS ), |
---|
1828 | CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ), |
---|
1829 | #endif |
---|
1830 | }; |
---|
1831 | #endif |
---|
1832 | |
---|
1833 | /** |
---|
1834 | * This calculates the memory required for the executive workspace. |
---|
1835 | */ |
---|
1836 | #define CONFIGURE_EXECUTIVE_RAM_SIZE \ |
---|
1837 | (( \ |
---|
1838 | CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD + \ |
---|
1839 | CONFIGURE_MEMORY_FOR_DEVFS + \ |
---|
1840 | CONFIGURE_MEMORY_FOR_TASKS( \ |
---|
1841 | CONFIGURE_TOTAL_TASKS_AND_THREADS, CONFIGURE_TOTAL_TASKS_AND_THREADS) + \ |
---|
1842 | CONFIGURE_MEMORY_FOR_CLASSIC + \ |
---|
1843 | CONFIGURE_MEMORY_FOR_POSIX + \ |
---|
1844 | (CONFIGURE_MAXIMUM_POSIX_THREADS * CONFIGURE_MINIMUM_TASK_STACK_SIZE ) + \ |
---|
1845 | CONFIGURE_INITIALIZATION_THREADS_STACKS + \ |
---|
1846 | CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS + \ |
---|
1847 | CONFIGURE_MEMORY_FOR_MP + \ |
---|
1848 | CONFIGURE_MESSAGE_BUFFER_MEMORY + \ |
---|
1849 | (CONFIGURE_MEMORY_OVERHEAD * 1024) + \ |
---|
1850 | (CONFIGURE_EXTRA_TASK_STACKS) + (CONFIGURE_ADA_TASKS_STACK) \ |
---|
1851 | ) & ~0x7) |
---|
1852 | #endif |
---|
1853 | |
---|
1854 | #ifdef CONFIGURE_INIT |
---|
1855 | /** |
---|
1856 | * This is the Classic API Configuration Table. |
---|
1857 | */ |
---|
1858 | rtems_api_configuration_table Configuration_RTEMS_API = { |
---|
1859 | CONFIGURE_MAXIMUM_TASKS, |
---|
1860 | CONFIGURE_NOTEPADS_ENABLED, |
---|
1861 | CONFIGURE_MAXIMUM_TIMERS + CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER, |
---|
1862 | CONFIGURE_SEMAPHORES, |
---|
1863 | CONFIGURE_MAXIMUM_MESSAGE_QUEUES, |
---|
1864 | CONFIGURE_MAXIMUM_PARTITIONS, |
---|
1865 | CONFIGURE_MAXIMUM_REGIONS, |
---|
1866 | CONFIGURE_MAXIMUM_PORTS, |
---|
1867 | CONFIGURE_MAXIMUM_PERIODS, |
---|
1868 | CONFIGURE_MAXIMUM_BARRIERS, |
---|
1869 | CONFIGURE_INIT_TASK_TABLE_SIZE, |
---|
1870 | CONFIGURE_INIT_TASK_TABLE |
---|
1871 | }; |
---|
1872 | |
---|
1873 | #ifdef RTEMS_POSIX_API |
---|
1874 | /** |
---|
1875 | * This is the POSIX API Configuration Table. |
---|
1876 | */ |
---|
1877 | posix_api_configuration_table Configuration_POSIX_API = { |
---|
1878 | CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS, |
---|
1879 | CONFIGURE_MAXIMUM_POSIX_MUTEXES + CONFIGURE_GNAT_MUTEXES + |
---|
1880 | CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS, |
---|
1881 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES + |
---|
1882 | CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS, |
---|
1883 | CONFIGURE_MAXIMUM_POSIX_KEYS, |
---|
1884 | CONFIGURE_MAXIMUM_POSIX_TIMERS, |
---|
1885 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS, |
---|
1886 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES, |
---|
1887 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS, |
---|
1888 | CONFIGURE_MAXIMUM_POSIX_SEMAPHORES, |
---|
1889 | CONFIGURE_MAXIMUM_POSIX_BARRIERS, |
---|
1890 | CONFIGURE_MAXIMUM_POSIX_RWLOCKS, |
---|
1891 | CONFIGURE_MAXIMUM_POSIX_SPINLOCKS, |
---|
1892 | CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE, |
---|
1893 | CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME |
---|
1894 | }; |
---|
1895 | #endif |
---|
1896 | |
---|
1897 | /** This variable specifies the minimum stack size for tasks in an RTEMS |
---|
1898 | * application. |
---|
1899 | * |
---|
1900 | * @note This is left as a simple uint32_t so it can be externed as |
---|
1901 | * needed without requring being high enough logical to |
---|
1902 | * include the full configuration table. |
---|
1903 | */ |
---|
1904 | uint32_t rtems_minimum_stack_size = |
---|
1905 | CONFIGURE_MINIMUM_TASK_STACK_SIZE; |
---|
1906 | |
---|
1907 | /** This variable specifies the maximum priority value that |
---|
1908 | * a task may have. This must be a power of 2 between 4 |
---|
1909 | * and 256 and is specified in terms of Classic API |
---|
1910 | * priority values. |
---|
1911 | * |
---|
1912 | * @note This is left as a simple uint8_t so it can be externed as |
---|
1913 | * needed without requring being high enough logical to |
---|
1914 | * include the full configuration table. |
---|
1915 | */ |
---|
1916 | uint8_t rtems_maximum_priority = CONFIGURE_MAXIMUM_PRIORITY; |
---|
1917 | |
---|
1918 | /** |
---|
1919 | * This is the primary Configuration Table for this application. |
---|
1920 | */ |
---|
1921 | rtems_configuration_table Configuration = { |
---|
1922 | NULL, /* filled in by BSP */ |
---|
1923 | CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */ |
---|
1924 | CONFIGURE_MAXIMUM_USER_EXTENSIONS, /* maximum dynamic extensions */ |
---|
1925 | CONFIGURE_MICROSECONDS_PER_TICK, /* microseconds per clock tick */ |
---|
1926 | CONFIGURE_TICKS_PER_TIMESLICE, /* ticks per timeslice quantum */ |
---|
1927 | CONFIGURE_IDLE_TASK_BODY, /* user's IDLE task */ |
---|
1928 | CONFIGURE_IDLE_TASK_STACK_SIZE, /* IDLE task stack size */ |
---|
1929 | CONFIGURE_INTERRUPT_STACK_SIZE, /* interrupt stack size */ |
---|
1930 | CONFIGURE_TASK_STACK_ALLOCATOR, /* stack allocator */ |
---|
1931 | CONFIGURE_TASK_STACK_DEALLOCATOR, /* stack deallocator */ |
---|
1932 | CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY, /* true to clear memory */ |
---|
1933 | CONFIGURE_MAXIMUM_DRIVERS, /* maximum device drivers */ |
---|
1934 | CONFIGURE_NUMBER_OF_DRIVERS, /* static device drivers */ |
---|
1935 | Device_drivers, /* pointer to driver table */ |
---|
1936 | CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS, /* number of static extensions */ |
---|
1937 | CONFIGURE_INITIAL_EXTENSION_TABLE, /* pointer to static extensions */ |
---|
1938 | #if defined(RTEMS_MULTIPROCESSING) |
---|
1939 | CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */ |
---|
1940 | #endif |
---|
1941 | }; |
---|
1942 | #endif |
---|
1943 | |
---|
1944 | #endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */ |
---|
1945 | |
---|
1946 | /* |
---|
1947 | * If the user has configured a set of Classic API Initialization Tasks, |
---|
1948 | * then we need to install the code that runs that loop. |
---|
1949 | */ |
---|
1950 | #ifdef CONFIGURE_INIT |
---|
1951 | #if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) || \ |
---|
1952 | defined(CONFIGURE_HAS_OWN_INIT_TASK_TABLE) |
---|
1953 | void (_RTEMS_tasks_Initialize_user_tasks_body)(void); |
---|
1954 | void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) = |
---|
1955 | _RTEMS_tasks_Initialize_user_tasks_body; |
---|
1956 | #else |
---|
1957 | void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) = NULL; |
---|
1958 | #endif |
---|
1959 | #endif |
---|
1960 | |
---|
1961 | /* |
---|
1962 | * If the user has configured a set of POSIX Initialization Threads, |
---|
1963 | * then we need to install the code that runs that loop. |
---|
1964 | */ |
---|
1965 | #ifdef RTEMS_POSIX_API |
---|
1966 | #ifdef CONFIGURE_INIT |
---|
1967 | #if defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) || \ |
---|
1968 | defined(CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE) |
---|
1969 | void _POSIX_Threads_Initialize_user_threads_body(void); |
---|
1970 | void (*_POSIX_Threads_Initialize_user_threads_p)(void) = |
---|
1971 | _POSIX_Threads_Initialize_user_threads_body; |
---|
1972 | #else |
---|
1973 | void (*_POSIX_Threads_Initialize_user_threads_p)(void) = NULL; |
---|
1974 | #endif |
---|
1975 | #endif |
---|
1976 | #endif |
---|
1977 | |
---|
1978 | #ifdef __cplusplus |
---|
1979 | } |
---|
1980 | #endif |
---|
1981 | |
---|
1982 | /****************************************************************** |
---|
1983 | ****************************************************************** |
---|
1984 | ****************************************************************** |
---|
1985 | * CONFIGURATION WARNINGS AND ERROR CHECKING * |
---|
1986 | ****************************************************************** |
---|
1987 | ****************************************************************** |
---|
1988 | ****************************************************************** |
---|
1989 | */ |
---|
1990 | |
---|
1991 | /* |
---|
1992 | * Make sure a task/thread of some sort is configured. |
---|
1993 | * |
---|
1994 | * When analyzing RTEMS to find the smallest possible of memory |
---|
1995 | * that must be allocated, you probably do want to configure 0 |
---|
1996 | * tasks/threads so there is a smaller set of calls to _Workspace_Allocate |
---|
1997 | * to analyze. |
---|
1998 | */ |
---|
1999 | #if !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) |
---|
2000 | #if (CONFIGURE_MAXIMUM_TASKS == 0) && \ |
---|
2001 | (CONFIGURE_MAXIMUM_POSIX_THREADS == 0) && \ |
---|
2002 | (CONFIGURE_MAXIMUM_ADA_TASKS == 0) |
---|
2003 | #error "CONFIGURATION ERROR: No tasks or threads configured!!" |
---|
2004 | #endif |
---|
2005 | #endif |
---|
2006 | |
---|
2007 | /* |
---|
2008 | * Make sure at least one of the initialization task/thread |
---|
2009 | * tables was defined. |
---|
2010 | */ |
---|
2011 | #if !defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) && \ |
---|
2012 | !defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) && \ |
---|
2013 | !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) |
---|
2014 | #error "CONFIGURATION ERROR: No initialization tasks or threads configured!!" |
---|
2015 | #endif |
---|
2016 | |
---|
2017 | /* |
---|
2018 | * If the user is trying to configure a multiprocessing application and |
---|
2019 | * RTEMS was not configured and built multiprocessing, then error out. |
---|
2020 | */ |
---|
2021 | #if defined(CONFIGURE_MP_APPLICATION) && \ |
---|
2022 | !defined(RTEMS_MULTIPROCESSING) |
---|
2023 | #error "CONFIGURATION ERROR: RTEMS not configured for multiprocessing!!" |
---|
2024 | #endif |
---|
2025 | |
---|
2026 | /* |
---|
2027 | * If an attempt was made to configure POSIX objects and |
---|
2028 | * the POSIX API was not configured into RTEMS, error out. |
---|
2029 | */ |
---|
2030 | #if !defined(RTEMS_POSIX_API) |
---|
2031 | #if ((CONFIGURE_MAXIMUM_POSIX_THREADS != 0) || \ |
---|
2032 | (CONFIGURE_MAXIMUM_POSIX_MUTEXES != 0) || \ |
---|
2033 | (CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES != 0) || \ |
---|
2034 | (CONFIGURE_MAXIMUM_POSIX_KEYS != 0) || \ |
---|
2035 | (CONFIGURE_MAXIMUM_POSIX_TIMERS != 0) || \ |
---|
2036 | (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0) || \ |
---|
2037 | (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES != 0) || \ |
---|
2038 | (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS != 0) || \ |
---|
2039 | (CONFIGURE_MAXIMUM_POSIX_SEMAPHORES != 0) || \ |
---|
2040 | (CONFIGURE_MAXIMUM_POSIX_BARRIERS != 0) || \ |
---|
2041 | (CONFIGURE_MAXIMUM_POSIX_SPINLOCKS != 0) || \ |
---|
2042 | (CONFIGURE_MAXIMUM_POSIX_RWLOCKS != 0) || \ |
---|
2043 | defined(CONFIGURE_POSIX_INIT_THREAD_TABLE)) |
---|
2044 | #error "CONFIGURATION ERROR: POSIX API support not configured!!" |
---|
2045 | #endif |
---|
2046 | #endif |
---|
2047 | |
---|
2048 | /* |
---|
2049 | * You must either explicity include or exclude the clock driver. |
---|
2050 | * It is such a common newbie error to leave it out. Maybe this |
---|
2051 | * will put an end to it. |
---|
2052 | * |
---|
2053 | * NOTE: If you are using the timer driver, it is considered |
---|
2054 | * mutually exclusive with the clock driver because the |
---|
2055 | * drivers are assumed to use the same "timer" hardware |
---|
2056 | * on many boards. |
---|
2057 | */ |
---|
2058 | #if !defined(CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE) |
---|
2059 | #if !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \ |
---|
2060 | !defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER) && \ |
---|
2061 | !defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER) |
---|
2062 | #error "CONFIGURATION ERROR: Do you want the clock driver or not?!?" |
---|
2063 | #endif |
---|
2064 | #endif |
---|
2065 | |
---|
2066 | /* |
---|
2067 | * These names have been obsoleted so make the user application stop compiling |
---|
2068 | */ |
---|
2069 | #if defined(CONFIGURE_TEST_NEEDS_TIMER_DRIVER) || \ |
---|
2070 | defined(CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER) || \ |
---|
2071 | defined(CONFIGURE_TEST_NEEDS_CLOCK_DRIVER) || \ |
---|
2072 | defined(CONFIGURE_TEST_NEEDS_RTC_DRIVER) || \ |
---|
2073 | defined(CONFIGURE_TEST_NEEDS_STUB_DRIVER) |
---|
2074 | #error "CONFIGURATION ERROR: CONFIGURE_TEST_XXX constants are obsolete" |
---|
2075 | #endif |
---|
2076 | |
---|
2077 | /* |
---|
2078 | * Validate the configured maximum priority |
---|
2079 | */ |
---|
2080 | #if ((CONFIGURE_MAXIMUM_PRIORITY != 3) && \ |
---|
2081 | (CONFIGURE_MAXIMUM_PRIORITY != 7) && \ |
---|
2082 | (CONFIGURE_MAXIMUM_PRIORITY != 15) && \ |
---|
2083 | (CONFIGURE_MAXIMUM_PRIORITY != 31) && \ |
---|
2084 | (CONFIGURE_MAXIMUM_PRIORITY != 63) && \ |
---|
2085 | (CONFIGURE_MAXIMUM_PRIORITY != 127) && \ |
---|
2086 | (CONFIGURE_MAXIMUM_PRIORITY != 255)) |
---|
2087 | #error "Maximum priority is not 1 less than a power of 2 between 4 and 256" |
---|
2088 | #endif |
---|
2089 | |
---|
2090 | #if (CONFIGURE_MAXIMUM_PRIORITY > PRIORITY_DEFAULT_MAXIMUM) |
---|
2091 | #error "Maximum priority configured higher than supported by target." |
---|
2092 | #endif |
---|
2093 | |
---|
2094 | /* |
---|
2095 | * If you have fewer POSIX Message Queue Descriptors than actual |
---|
2096 | * POSIX Message Queues, then you will not be able to open all the |
---|
2097 | * queues. |
---|
2098 | */ |
---|
2099 | #if (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS < \ |
---|
2100 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) |
---|
2101 | #error "Fewer POSIX Message Queue descriptors than Queues!" |
---|
2102 | #endif |
---|
2103 | |
---|
2104 | #endif |
---|
2105 | /* end of include file */ |
---|