37#ifndef _RTEMS_CONFDEFS_WKSPACE_H
38#define _RTEMS_CONFDEFS_WKSPACE_H
40#ifndef __CONFIGURATION_TEMPLATE_h
41#error "Do not include this file directly, use <rtems/confdefs.h> instead"
59#if CPU_STACK_ALIGNMENT > CPU_HEAP_ALIGNMENT
60 #define _CONFIGURE_TASK_STACK_ALLOC_SIZE( _stack_size ) \
62 ( _stack_size ) + CONTEXT_FP_SIZE, \
64 ) + CPU_STACK_ALIGNMENT - CPU_HEAP_ALIGNMENT )
66 #define _CONFIGURE_TASK_STACK_ALLOC_SIZE( _stack_size ) \
67 RTEMS_ALIGN_UP( ( _stack_size ) + CONTEXT_FP_SIZE, CPU_STACK_ALIGNMENT )
70#ifdef CONFIGURE_TASK_STACK_FROM_ALLOCATOR
71 #define _Configure_From_stackspace( _stack_size ) \
72 CONFIGURE_TASK_STACK_FROM_ALLOCATOR( \
73 _CONFIGURE_TASK_STACK_ALLOC_SIZE( _stack_size ) \
76 #define _Configure_From_stackspace( _stack_size ) \
77 _Configure_From_workspace( \
78 _CONFIGURE_TASK_STACK_ALLOC_SIZE( _stack_size ) \
82#ifndef CONFIGURE_EXTRA_TASK_STACKS
83 #define CONFIGURE_EXTRA_TASK_STACKS 0
86#ifndef CONFIGURE_EXECUTIVE_RAM_SIZE
88#define CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( _messages, _size ) \
89 _Configure_From_workspace( \
90 ( _messages ) * ( _Configure_Align_up( _size, sizeof( uintptr_t ) ) \
91 + sizeof( CORE_message_queue_Buffer ) ) )
93#ifndef CONFIGURE_MESSAGE_BUFFER_MEMORY
94 #define CONFIGURE_MESSAGE_BUFFER_MEMORY 0
97#ifndef CONFIGURE_MEMORY_OVERHEAD
98 #define CONFIGURE_MEMORY_OVERHEAD 0
106#define _CONFIGURE_HEAP_HANDLER_OVERHEAD \
107 _Configure_Align_up( HEAP_BLOCK_HEADER_SIZE, CPU_HEAP_ALIGNMENT )
109#define CONFIGURE_EXECUTIVE_RAM_SIZE \
110 ( _CONFIGURE_MEMORY_FOR_POSIX_OBJECTS \
111 + CONFIGURE_MESSAGE_BUFFER_MEMORY \
112 + 1024 * CONFIGURE_MEMORY_OVERHEAD \
113 + _CONFIGURE_HEAP_HANDLER_OVERHEAD )
115#if defined(CONFIGURE_IDLE_TASK_STORAGE_SIZE) || \
116 defined(CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE)
117 #define _CONFIGURE_IDLE_TASK_STACKS 0
119 #define _CONFIGURE_IDLE_TASK_STACKS \
120 ( _CONFIGURE_MAXIMUM_PROCESSORS * \
121 _Configure_From_stackspace( CONFIGURE_IDLE_TASK_STACK_SIZE ) )
124#define _CONFIGURE_STACK_SPACE_SIZE \
125 ( _CONFIGURE_INIT_TASK_STACK_EXTRA \
126 + _CONFIGURE_IDLE_TASK_STACKS \
127 + _CONFIGURE_POSIX_INIT_THREAD_STACK_EXTRA \
128 + _CONFIGURE_LIBBLOCK_TASKS_STACK_EXTRA \
129 + CONFIGURE_EXTRA_TASK_STACKS \
130 + rtems_resource_maximum_per_allocation( \
131 _CONFIGURE_TASKS - CONFIGURE_MINIMUM_TASKS_WITH_USER_PROVIDED_STORAGE \
133 * _Configure_From_stackspace( CONFIGURE_MINIMUM_TASK_STACK_SIZE ) \
134 + rtems_resource_maximum_per_allocation( CONFIGURE_MAXIMUM_POSIX_THREADS ) \
135 * _Configure_From_stackspace( CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE ) \
136 + _CONFIGURE_HEAP_HANDLER_OVERHEAD )
140#if CONFIGURE_EXTRA_TASK_STACKS != 0
141 #error "CONFIGURE_EXECUTIVE_RAM_SIZE defined with request for CONFIGURE_EXTRA_TASK_STACKS"
144#define _CONFIGURE_STACK_SPACE_SIZE 0
154#ifdef CONFIGURE_UNIFIED_WORK_AREAS
165#if defined(CONFIGURE_TASK_STACK_ALLOCATOR) \
166 && defined(CONFIGURE_TASK_STACK_DEALLOCATOR)
176 #pragma GCC diagnostic push
177 #pragma GCC diagnostic ignored "-Waddress"
178 #pragma GCC diagnostic ignored "-Wpragmas"
179 #pragma GCC diagnostic ignored "-Wtautological-pointer-compare"
182 #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE
189 #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_INIT
191 _CONFIGURE_ASSERT_NOT_NULL(
198 RTEMS_SYSINIT_STACK_ALLOCATOR,
199 RTEMS_SYSINIT_ORDER_MIDDLE
205 _CONFIGURE_ASSERT_NOT_NULL(
211 _CONFIGURE_ASSERT_NOT_NULL(
216 #pragma GCC diagnostic pop
221#elif defined(CONFIGURE_TASK_STACK_ALLOCATOR) \
222 || defined(CONFIGURE_TASK_STACK_DEALLOCATOR)
223 #error "CONFIGURE_TASK_STACK_ALLOCATOR and CONFIGURE_TASK_STACK_DEALLOCATOR must be both defined or both undefined"
226#ifdef CONFIGURE_IDLE_TASK_STORAGE_SIZE
227 #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE
228 #error "CONFIGURE_IDLE_TASK_STORAGE_SIZE and CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE are mutually exclusive"
231 #define _CONFIGURE_IDLE_TASK_STORAGE_SIZE \
233 RTEMS_TASK_STORAGE_SIZE( \
234 CONFIGURE_IDLE_TASK_STORAGE_SIZE, \
235 RTEMS_DEFAULT_ATTRIBUTES \
237 CPU_INTERRUPT_STACK_ALIGNMENT \
241 _CONFIGURE_IDLE_TASK_STORAGE_SIZE;
244 _CONFIGURE_MAXIMUM_PROCESSORS * _CONFIGURE_IDLE_TASK_STORAGE_SIZE
248 #define CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE \
249 _Stack_Allocator_allocate_for_idle_static
252#ifndef CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE
253 #define CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE \
254 _Stack_Allocator_allocate_for_idle_workspace
260#ifdef CONFIGURE_DIRTY_MEMORY
263 RTEMS_SYSINIT_DIRTY_MEMORY,
264 RTEMS_SYSINIT_ORDER_MIDDLE
268#ifdef CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY
273 RTEMS_SYSINIT_ZERO_MEMORY,
274 RTEMS_SYSINIT_ORDER_MIDDLE
This header file evaluates configuration options related to the block device cache configuration.
This header file evaluates configuration options related to the per-CPU configuration.
This header file provides the interfaces of the Context Handler.
This header file provides interfaces of the Message Queue Handler which are only used by the implemen...
This header file provides the interfaces of the Memory Handler.
This header file provides interfaces of the Stack Handler which are used by the implementation and th...
#define RTEMS_SECTION(_section)
Instructs the compiler to place the variable or function in the section.
Definition: basedefs.h:411
#define RTEMS_ALIGNED(_alignment)
Instructs the compiler in a declaration or definition to enforce the alignment.
Definition: basedefs.h:157
#define RTEMS_SYSINIT_ITEM(handler, module, order)
Creates the system initialization item associated with the handler, module, and order.
Definition: sysinit.h:204
#define CONFIGURE_EXECUTIVE_RAM_SIZE
This configuration option is an integer define.
Definition: appl-config.h:2701
#define CONFIGURE_MINIMUM_TASK_STACK_SIZE
This configuration option is an integer define.
Definition: appl-config.h:3243
#define CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE
This configuration option is an initializer define.
Definition: appl-config.h:5152
const bool _Memory_Zero_before_use
Indicates if the memory is zeroed during system initialization.
Definition: memoryzerobeforeuse.c:43
void _Memory_Dirty_free_areas(void)
Dirty all free memory areas of the system.
Definition: memorydirtyfreeareas.c:45
void _Memory_Zero_free_areas(void)
Zeros all free memory areas of the system.
Definition: memoryzerofreeareas.c:45
char _Stack_Allocator_allocate_for_idle_storage_areas[]
The thread storage areas used by _Stack_Allocator_allocate_for_idle_static().
void(* Stack_Allocator_initialize)(size_t stack_space_size)
The stack allocator initialization handler.
Definition: stack.h:83
const Stack_Allocator_allocate_for_idle _Stack_Allocator_allocate_for_idle
The stack allocator allocate stack for idle thread handler.
void _Stack_Allocator_do_initialize(void)
Do the stack allocator initialization during system initialize.
Definition: stackallocatorinit.c:44
void *(* Stack_Allocator_allocate_for_idle)(uint32_t cpu, size_t *stack_size)
Stack allocator allocate for idle handler.
Definition: stack.h:121
const bool _Stack_Allocator_avoids_workspace
Indicates if the stack allocator avoids the workspace.
Definition: stackallocator.c:45
void *(* Stack_Allocator_allocate)(size_t stack_size)
Stack allocator allocate handler.
Definition: stack.h:93
const uintptr_t _Stack_Space_size
The configured stack space size.
const Stack_Allocator_allocate _Stack_Allocator_allocate
The stack allocator allocate handler.
Definition: stackallocator.c:47
const size_t _Stack_Allocator_allocate_for_idle_storage_size
The size in bytes of the idle thread storage area used by _Stack_Allocator_allocate_for_idle_static()...
const Stack_Allocator_free _Stack_Allocator_free
The stack allocator free handler.
Definition: stackallocatorfree.c:44
const Stack_Allocator_initialize _Stack_Allocator_initialize
The stack allocator initialization handler.
void(* Stack_Allocator_free)(void *addr)
Stack allocator free handler.
Definition: stack.h:100
uint32_t rtems_minimum_stack_size
The minimum stack size.
const bool _Workspace_Is_unified
Indicates if the workspace and C program heap are unified.
Definition: wkspaceisunifieddefault.c:43
struct Heap_Control *(*const _Workspace_Malloc_initializer)(void)
This constant provides the C Program Heap initialization handler.
Definition: wkspacemallocinitdefault.c:43
const uintptr_t _Workspace_Size
The workspace size in bytes.
struct Heap_Control * _Workspace_Malloc_initialize_unified(void)
Initializes the C Program Heap so that it is unified with the RTEMS Workspace.
Definition: wkspacemallocinitunified.c:44
#define CONFIGURE_TASK_STACK_ALLOCATOR_INIT
Task stack allocator initialization configuration option.
Definition: stackalloc.h:89
#define CONFIGURE_TASK_STACK_ALLOCATOR
Task stack allocator configuration option.
Definition: stackalloc.h:94
#define CONFIGURE_TASK_STACK_DEALLOCATOR
Task stack deallocator configuration option.
Definition: stackalloc.h:99
This header file evaluates configuration options related to the Classic API initialization task confi...
This header file evaluates configuration options related to the POSIX initialization thread configura...
#define CPU_INTERRUPT_STACK_ALIGNMENT
Definition: cpu.h:632
This header file evaluates configuration options related to the POSIX API objects configuration.
Control block used to manage a heap.
Definition: heap.h:339
This header file provides the API of the System Initialization Support.
This header file evaluates configuration options related to the thread configuration.
This header file provides support macros to evaluate configuration options related to the RTEMS Works...