26.7. General System Configuration#

This section describes general system configuration options.

26.7.1. CONFIGURE_DIRTY_MEMORY#

CONSTANT:

CONFIGURE_DIRTY_MEMORY

OPTION TYPE:

This configuration option is a boolean feature define.

DEFAULT CONFIGURATION:

If this configuration option is undefined, then the described feature is not enabled.

DESCRIPTION:

In case this configuration option is defined, then the memory areas used for the RTEMS Workspace and the C Program Heap are dirtied with a 0xCF byte pattern during system initialization.

NOTES:

Dirtying memory can add significantly to system initialization time. It may assist in finding code that incorrectly assumes the contents of free memory areas is cleared to zero during system initialization. In case CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY is also defined, then the memory is first dirtied and then zeroed.

See also CONFIGURE_MALLOC_DIRTY.

26.7.2. CONFIGURE_DISABLE_BSP_SETTINGS#

CONSTANT:

CONFIGURE_DISABLE_BSP_SETTINGS

OPTION TYPE:

This configuration option is a boolean feature define.

DEFAULT CONFIGURATION:

If this configuration option is undefined, then the described feature is not enabled.

DESCRIPTION:

In case this configuration option is defined, then the optional BSP provided settings listed below are disabled.

The optional BSP provided default values for the following application configuration options are disabled:

The optional BSP provided initial extension set is disabled (see initial extension sets). The optional BSP provided prerequisite IO device drivers are disabled (see Device Driver Configuration). The optional BSP provided support for sbrk() is disabled.

This configuration option provides an all or nothing choice with respect to the optional BSP provided settings.

26.7.3. CONFIGURE_DISABLE_NEWLIB_REENTRANCY#

CONSTANT:

CONFIGURE_DISABLE_NEWLIB_REENTRANCY

OPTION TYPE:

This configuration option is a boolean feature define.

DEFAULT CONFIGURATION:

If this configuration option is undefined, then the described feature is not enabled.

DESCRIPTION:

In case this configuration option is defined, then the Newlib reentrancy support per thread is disabled and a global reentrancy structure is used.

NOTES:

You can enable this option to reduce the size of the TCB. Use this option with care, since it can lead to race conditions and undefined system behaviour. For example, errno is no longer a thread-local variable if this option is enabled.

26.7.4. CONFIGURE_EXECUTIVE_RAM_SIZE#

CONSTANT:

CONFIGURE_EXECUTIVE_RAM_SIZE

OPTION TYPE:

This configuration option is an integer define.

DEFAULT VALUE:

If this configuration option is undefined, then the RTEMS Workspace and task stack space size is calculated by <rtems/confdefs.h> based on the values configuration options.

DESCRIPTION:

The value of this configuration option defines the RTEMS Workspace size in bytes.

NOTES:

This is an advanced configuration option. Use it only if you know exactly what you are doing.

CONSTRAINTS:

The following constraints apply to this configuration option:

  • The value of the configuration option shall be greater than or equal to zero.

  • The value of the configuration option shall be less than or equal to UINTPTR_MAX.

  • The value of the configuration option shall be less than or equal to a BSP-specific and application-specific value which depends on the size of the memory available to the application.

26.7.5. CONFIGURE_EXTRA_TASK_STACKS#

CONSTANT:

CONFIGURE_EXTRA_TASK_STACKS

OPTION TYPE:

This configuration option is an integer define.

DEFAULT VALUE:

The default value is 0.

DESCRIPTION:

The value of this configuration option defines the number of bytes the applications wishes to add to the task stack requirements calculated by <rtems/confdefs.h>.

NOTES:

This parameter is very important. If the application creates tasks with stacks larger then the minimum, then that memory is not accounted for by <rtems/confdefs.h>.

CONSTRAINTS:

The following constraints apply to this configuration option:

  • The value of the configuration option shall be greater than or equal to zero.

  • The value of the configuration option shall be small enough so that the task stack space calculation carried out by <rtems/confdefs.h> does not overflow an integer of type uintptr_t.

26.7.6. CONFIGURE_INIT#

CONSTANT:

CONFIGURE_INIT

OPTION TYPE:

This configuration option is a boolean feature define.

DEFAULT CONFIGURATION:

There is no default configuration associated with this configuration option. If <rtems/confdefs.h> is included and this configuration option is not defined, then only white space is included.

DESCRIPTION:

While this configuration option is defined, when the <rtems/confdefs.h> is included, the system settings defined by present application configuration options are statically allocated and initialized. All user provided application configuration options defined before the include of <rtems/confdefs.h> are evaluated. They define the actual system settings.

26.7.7. CONFIGURE_INITIAL_EXTENSIONS#

CONSTANT:

CONFIGURE_INITIAL_EXTENSIONS

OPTION TYPE:

This configuration option is an initializer define.

DEFAULT VALUE:

The default value is the empty list.

DESCRIPTION:

The value of this configuration option is used to initialize the table of initial user extensions.

NOTES:

The value of this configuration option is placed before the entries of BSP_INITIAL_EXTENSION and after the entries of all other initial user extensions.

It is recommended that applications provide a fatal extension to customize the System Termination Procedure.

CONSTRAINTS:

The value of the configuration option shall be a list of initializers for structures of type rtems_extensions_table.

26.7.8. CONFIGURE_INTERRUPT_STACK_SIZE#

CONSTANT:

CONFIGURE_INTERRUPT_STACK_SIZE

OPTION TYPE:

This configuration option is an integer define.

DEFAULT VALUE:

If the CONFIGURE_DISABLE_BSP_SETTINGS configuration option is not defined and BSP_INTERRUPT_STACK_SIZE is provided by the BSP, then the default value is defined by BSP_INTERRUPT_STACK_SIZE, otherwise the default value is CPU_STACK_MINIMUM_SIZE.

DESCRIPTION:

The value of this configuration option defines the size of an interrupt stack in bytes.

NOTES:

There is one interrupt stack available for each configured processor (CONFIGURE_MAXIMUM_PROCESSORS). The interrupt stack areas are statically allocated in a special linker section (.rtemsstack.interrupt). The placement of this linker section is BSP-specific.

Some BSPs use the interrupt stack as the initialization stack which is used to perform the sequential system initialization before the multithreading is started.

The interrupt stacks are covered by the stack checker, see CONFIGURE_STACK_CHECKER_ENABLED. However, using a too small interrupt stack size may still result in undefined behaviour.

The interrupt stack size may depend on the interrupt priority settings, see also rtems_interrupt_set_priority().

In releases before RTEMS 5.1 the default value was CONFIGURE_MINIMUM_TASK_STACK_SIZE instead of CPU_STACK_MINIMUM_SIZE.

CONSTRAINTS:

The following constraints apply to this configuration option:

  • The value of the configuration option shall be greater than or equal to a BSP-specific and application-specific minimum value.

  • The value of the configuration option shall be small enough so that the interrupt stack area calculation carried out by <rtems/confdefs.h> does not overflow an integer of type size_t.

  • The value of the configuration option shall be aligned according to CPU_INTERRUPT_STACK_ALIGNMENT.

26.7.9. CONFIGURE_MALLOC_DIRTY#

CONSTANT:

CONFIGURE_MALLOC_DIRTY

OPTION TYPE:

This configuration option is a boolean feature define.

DEFAULT CONFIGURATION:

If this configuration option is undefined, then the described feature is not enabled.

DESCRIPTION:

In case this configuration option is defined, then each memory area returned by C Program Heap allocator functions such as malloc() is dirtied with a 0xCF byte pattern before it is handed over to the application.

NOTES:

The dirtying performed by this option is carried out for each successful memory allocation from the C Program Heap in contrast to CONFIGURE_DIRTY_MEMORY which dirties the memory only once during the system initialization.

26.7.10. CONFIGURE_MAXIMUM_FILE_DESCRIPTORS#

CONSTANT:

CONFIGURE_MAXIMUM_FILE_DESCRIPTORS

OPTION TYPE:

This configuration option is an integer define.

DEFAULT VALUE:

The default value is 3.

DESCRIPTION:

The value of this configuration option defines the maximum number of file like objects that can be concurrently open.

NOTES:

The default value of three file descriptors allows RTEMS to support standard input, output, and error I/O streams on /dev/console.

CONSTRAINTS:

The following constraints apply to this configuration option:

  • The value of the configuration option shall be greater than or equal to zero.

  • The value of the configuration option shall be less than or equal to SIZE_MAX.

  • The value of the configuration option shall be less than or equal to a BSP-specific and application-specific value which depends on the size of the memory available to the application.

26.7.11. CONFIGURE_MAXIMUM_PROCESSORS#

CONSTANT:

CONFIGURE_MAXIMUM_PROCESSORS

OPTION TYPE:

This configuration option is an integer define.

DEFAULT VALUE:

The default value is 1.

DESCRIPTION:

The value of this configuration option defines the maximum number of processors an application intends to use. The number of actually available processors depends on the hardware and may be less. It is recommended to use the smallest value suitable for the application in order to save memory. Each processor needs an IDLE task stack and interrupt stack for example.

NOTES:

If there are more processors available than configured, the rest will be ignored.

This configuration option is only evaluated in SMP configurations of RTEMS (e.g. RTEMS was built with the SMP build configuration option enabled). In all other configurations it has no effect.

CONSTRAINTS:

The following constraints apply to this configuration option:

  • The value of the configuration option shall be greater than or equal to one.

  • The value of the configuration option shall be less than or equal to CPU_MAXIMUM_PROCESSORS.

26.7.12. CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE#

CONSTANT:

CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE

OPTION TYPE:

This configuration option is an integer define.

DEFAULT VALUE:

The default value is 0.

DESCRIPTION:

If the value of this configuration option is greater than zero, then it defines the maximum thread-local storage size, otherwise the thread-local storage size is defined by the linker depending on the thread-local storage objects used by the application in the statically-linked executable.

NOTES:

This configuration option can be used to reserve space for the dynamic linking of modules with thread-local storage objects.

If the thread-local storage size defined by the thread-local storage objects used by the application in the statically-linked executable is greater than a non-zero value of this configuration option, then a fatal error will occur during system initialization.

Use RTEMS_ALIGN_UP() and RTEMS_TASK_STORAGE_ALIGNMENT to adjust the size to meet the minimum alignment requirement of a thread-local storage area.

The actual thread-local storage size is determined when the application executable is linked. The rtems-exeinfo command line tool included in the RTEMS Tools can be used to obtain the thread-local storage size and alignment of an application executable.

CONSTRAINTS:

The following constraints apply to this configuration option:

  • The value of the configuration option shall be greater than or equal to zero.

  • The value of the configuration option shall be less than or equal to SIZE_MAX.

  • The value of the configuration option shall be an integral multiple of RTEMS_TASK_STORAGE_ALIGNMENT.

26.7.13. CONFIGURE_MAXIMUM_THREAD_NAME_SIZE#

CONSTANT:

CONFIGURE_MAXIMUM_THREAD_NAME_SIZE

OPTION TYPE:

This configuration option is an integer define.

DEFAULT VALUE:

The default value is 16.

DESCRIPTION:

The value of this configuration option defines the maximum thread name size including the terminating NUL character.

NOTES:

The default value was chosen for Linux compatibility, see pthread_setname_np().

The size of the thread control block is increased by the maximum thread name size.

This configuration option is available since RTEMS 5.1.

CONSTRAINTS:

The following constraints apply to this configuration option:

  • The value of the configuration option shall be greater than or equal to zero.

  • The value of the configuration option shall be less than or equal to SIZE_MAX.

  • The value of the configuration option shall be less than or equal to a BSP-specific and application-specific value which depends on the size of the memory available to the application.

26.7.14. CONFIGURE_MEMORY_OVERHEAD#

CONSTANT:

CONFIGURE_MEMORY_OVERHEAD

OPTION TYPE:

This configuration option is an integer define.

DEFAULT VALUE:

The default value is 0.

DESCRIPTION:

The value of this configuration option defines the number of kilobytes the application wishes to add to the RTEMS Workspace size calculated by <rtems/confdefs.h>.

NOTES:

This configuration option should only be used when it is suspected that a bug in <rtems/confdefs.h> has resulted in an underestimation. Typically the memory allocation will be too low when an application does not account for all message queue buffers or task stacks, see CONFIGURE_MESSAGE_BUFFER_MEMORY.

CONSTRAINTS:

The following constraints apply to this configuration option:

  • The value of the configuration option shall be greater than or equal to zero.

  • The value of the configuration option shall be less than or equal to a BSP-specific and application-specific value which depends on the size of the memory available to the application.

  • The value of the configuration option shall be small enough so that the RTEMS Workspace size calculation carried out by <rtems/confdefs.h> does not overflow an integer of type uintptr_t.

26.7.15. CONFIGURE_MESSAGE_BUFFER_MEMORY#

CONSTANT:

CONFIGURE_MESSAGE_BUFFER_MEMORY

OPTION TYPE:

This configuration option is an integer define.

DEFAULT VALUE:

The default value is 0.

DESCRIPTION:

The value of this configuration option defines the number of bytes reserved for message queue buffers in the RTEMS Workspace.

NOTES:

The configuration options CONFIGURE_MAXIMUM_MESSAGE_QUEUES and CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES define only how many message queues can be created by the application. The memory for the message buffers is configured by this option. For each message queue you have to reserve some memory for the message buffers. The size depends on the maximum number of pending messages and the maximum size of the messages of a message queue. Use the CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE() macro to specify the message buffer memory for each message queue and sum them up to define the value for CONFIGURE_MAXIMUM_MESSAGE_QUEUES.

The interface for the CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE() help macro is as follows:

CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( max_messages, max_msg_size )

Where max_messages is the maximum number of pending messages and max_msg_size is the maximum size in bytes of the messages of the corresponding message queue. Both parameters shall be compile time constants. Not using this help macro (e.g. just using max_messages * max_msg_size) may result in an underestimate of the RTEMS Workspace size.

The following example illustrates how the CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE() help macro can be used to assist in calculating the message buffer memory required. In this example, there are two message queues used in this application. The first message queue has a maximum of 24 pending messages with the message structure defined by the type one_message_type. The other message queue has a maximum of 500 pending messages with the message structure defined by the type other_message_type.

#define CONFIGURE_MESSAGE_BUFFER_MEMORY ( \
    CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( \
      24, \
      sizeof( one_message_type ) \
    ) \
    + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( \
      500, \
      sizeof( other_message_type ) \
    ) \
  )

CONSTRAINTS:

The following constraints apply to this configuration option:

  • The value of the configuration option shall be greater than or equal to zero.

  • The value of the configuration option shall be less than or equal to a BSP-specific and application-specific value which depends on the size of the memory available to the application.

  • The value of the configuration option shall be small enough so that the RTEMS Workspace size calculation carried out by <rtems/confdefs.h> does not overflow an integer of type uintptr_t.

26.7.16. CONFIGURE_MICROSECONDS_PER_TICK#

CONSTANT:

CONFIGURE_MICROSECONDS_PER_TICK

OPTION TYPE:

This configuration option is an integer define.

DEFAULT VALUE:

The default value is 10000.

DESCRIPTION:

The value of this configuration option defines the length of time in microseconds between clock ticks (clock tick quantum).

When the clock tick quantum value is too low, the system will spend so much time processing clock ticks that it does not have processing time available to perform application work. In this case, the system will become unresponsive.

The lowest practical time quantum varies widely based upon the speed of the target hardware and the architectural overhead associated with interrupts. In general terms, you do not want to configure it lower than is needed for the application.

The clock tick quantum should be selected such that it all blocking and delay times in the application are evenly divisible by it. Otherwise, rounding errors will be introduced which may negatively impact the application.

NOTES:

This configuration option has no impact if the Clock Driver is not configured, see CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER.

There may be Clock Driver specific limits on the resolution or maximum value of a clock tick quantum.

CONSTRAINTS:

The following constraints apply to this configuration option:

  • The value of the configuration option shall be greater than or equal to a value defined by the Clock Driver.

  • The value of the configuration option shall be less than or equal to a value defined by the Clock Driver.

  • The resulting clock ticks per second should be an integer.

26.7.17. CONFIGURE_MINIMUM_TASK_STACK_SIZE#

CONSTANT:

CONFIGURE_MINIMUM_TASK_STACK_SIZE

OPTION TYPE:

This configuration option is an integer define.

DEFAULT VALUE:

The default value is CPU_STACK_MINIMUM_SIZE.

DESCRIPTION:

The value of this configuration option defines the minimum stack size in bytes for every user task or thread in the system.

NOTES:

Adjusting this parameter should be done with caution. Examining the actual stack usage using the stack checker usage reporting facility is recommended (see also CONFIGURE_STACK_CHECKER_ENABLED).

This parameter can be used to lower the minimum from that recommended. This can be used in low memory systems to reduce memory consumption for stacks. However, this shall be done with caution as it could increase the possibility of a blown task stack.

This parameter can be used to increase the minimum from that recommended. This can be used in higher memory systems to reduce the risk of stack overflow without performing analysis on actual consumption.

By default, this configuration parameter defines also the minimum stack size of POSIX threads. This can be changed with the CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE configuration option.

In releases before RTEMS 5.1 the CONFIGURE_MINIMUM_TASK_STACK_SIZE was used to define the default value of CONFIGURE_INTERRUPT_STACK_SIZE.

CONSTRAINTS:

The following constraints apply to this configuration option:

  • The value of the configuration option shall be small enough so that the task stack space calculation carried out by <rtems/confdefs.h> does not overflow an integer of type uintptr_t.

  • The value of the configuration option shall be greater than or equal to a BSP-specific and application-specific minimum value.

26.7.18. CONFIGURE_STACK_CHECKER_ENABLED#

CONSTANT:

CONFIGURE_STACK_CHECKER_ENABLED

OPTION TYPE:

This configuration option is a boolean feature define.

DEFAULT CONFIGURATION:

If this configuration option is undefined, then the described feature is not enabled.

DESCRIPTION:

In case this configuration option is defined, then the stack checker is enabled.

NOTES:

The stack checker performs run-time stack bounds checking. This increases the time required to create tasks as well as adding overhead to each context switch.

In 4.9 and older, this configuration option was named STACK_CHECKER_ON.

26.7.19. CONFIGURE_TICKS_PER_TIMESLICE#

CONSTANT:

CONFIGURE_TICKS_PER_TIMESLICE

OPTION TYPE:

This configuration option is an integer define.

DEFAULT VALUE:

The default value is 50.

DESCRIPTION:

The value of this configuration option defines the length of the timeslice quantum in ticks for each task.

NOTES:

This configuration option has no impact if the Clock Driver is not configured, see CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER.

CONSTRAINTS:

The following constraints apply to this configuration option:

  • The value of the configuration option shall be greater than or equal to one.

  • The value of the configuration option shall be less than or equal to UINT32_MAX.

26.7.20. CONFIGURE_UNIFIED_WORK_AREAS#

CONSTANT:

CONFIGURE_UNIFIED_WORK_AREAS

OPTION TYPE:

This configuration option is a boolean feature define.

DEFAULT CONFIGURATION:

If this configuration option is undefined, then there will be separate memory pools for the RTEMS Workspace and C Program Heap.

DESCRIPTION:

In case this configuration option is defined, then the RTEMS Workspace and the C Program Heap will be one pool of memory.

NOTES:

Having separate pools does have some advantages in the event a task blows a stack or writes outside its memory area. However, in low memory systems the overhead of the two pools plus the potential for unused memory in either pool is very undesirable.

In high memory environments, this is desirable when you want to use the Unlimited Objects option. You will be able to create objects until you run out of all available memory rather then just until you run out of RTEMS Workspace.

26.7.21. CONFIGURE_UNLIMITED_ALLOCATION_SIZE#

CONSTANT:

CONFIGURE_UNLIMITED_ALLOCATION_SIZE

OPTION TYPE:

This configuration option is an integer define.

DEFAULT VALUE:

The default value is 8.

DESCRIPTION:

If CONFIGURE_UNLIMITED_OBJECTS is defined, then the value of this configuration option defines the default objects maximum of all object classes supporting Unlimited Objects to rtems_resource_unlimited( CONFIGURE_UNLIMITED_ALLOCATION_SIZE ).

NOTES:

By allowing users to declare all resources as being unlimited the user can avoid identifying and limiting the resources used.

The object maximum of each class can be configured also individually using the rtems_resource_unlimited() macro.

CONSTRAINTS:

The value of the configuration option shall meet the constraints of all object classes to which it is applied.

26.7.22. CONFIGURE_UNLIMITED_OBJECTS#

CONSTANT:

CONFIGURE_UNLIMITED_OBJECTS

OPTION TYPE:

This configuration option is a boolean feature define.

DEFAULT CONFIGURATION:

If this configuration option is undefined, then the described feature is not enabled.

DESCRIPTION:

In case this configuration option is defined, then unlimited objects are used by default.

NOTES:

When using unlimited objects, it is common practice to also specify CONFIGURE_UNIFIED_WORK_AREAS so the system operates with a single pool of memory for both RTEMS Workspace and C Program Heap.

This option does not override an explicit configuration for a particular object class by the user.

See also CONFIGURE_UNLIMITED_ALLOCATION_SIZE.

26.7.23. CONFIGURE_VERBOSE_SYSTEM_INITIALIZATION#

CONSTANT:

CONFIGURE_VERBOSE_SYSTEM_INITIALIZATION

OPTION TYPE:

This configuration option is a boolean feature define.

DEFAULT CONFIGURATION:

If this configuration option is undefined, then the described feature is not enabled.

DESCRIPTION:

In case this configuration option is defined, then the system initialization is verbose.

NOTES:

You may use this feature to debug system initialization issues. The printk() function is used to print the information.

26.7.24. CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY#

CONSTANT:

CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY

OPTION TYPE:

This configuration option is a boolean feature define.

DEFAULT CONFIGURATION:

If this configuration option is undefined, then the described feature is not enabled.

DESCRIPTION:

In case this configuration option is defined, then the memory areas used for the RTEMS Workspace and the C Program Heap are zeroed with a 0x00 byte pattern during system initialization.

NOTES:

Zeroing memory can add significantly to the system initialization time. It is not necessary for RTEMS but is often assumed by support libraries. In case CONFIGURE_DIRTY_MEMORY is also defined, then the memory is first dirtied and then zeroed.