source: rtems/cpukit/sapi/include/confdefs.h @ 3899a537

4.104.114.95
Last change on this file since 3899a537 was 3899a537, checked in by Chris Johns <chrisj@…>, on 07/29/08 at 02:21:15

2008-07-29 Chris Johns <chrisj@…>

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