1 | .. SPDX-License-Identifier: CC-BY-SA-4.0 |
---|
2 | |
---|
3 | .. Copyright (C) 2020, 2022 embedded brains GmbH & Co. KG |
---|
4 | .. Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) |
---|
5 | |
---|
6 | .. This file is part of the RTEMS quality process and was automatically |
---|
7 | .. generated. If you find something that needs to be fixed or |
---|
8 | .. worded better please post a report or patch to an RTEMS mailing list |
---|
9 | .. or raise a bug report: |
---|
10 | .. |
---|
11 | .. https://www.rtems.org/bugs.html |
---|
12 | .. |
---|
13 | .. For information on updating and regenerating please refer to the How-To |
---|
14 | .. section in the Software Requirements Engineering chapter of the |
---|
15 | .. RTEMS Software Engineering manual. The manual is provided as a part of |
---|
16 | .. a release. For development sources please refer to the online |
---|
17 | .. documentation at: |
---|
18 | .. |
---|
19 | .. https://docs.rtems.org |
---|
20 | |
---|
21 | .. Generated from spec:/acfg/if/group-idle |
---|
22 | |
---|
23 | Idle Task Configuration |
---|
24 | ======================= |
---|
25 | |
---|
26 | This section describes configuration options related to the idle tasks. |
---|
27 | |
---|
28 | .. Generated from spec:/acfg/if/idle-task-body |
---|
29 | |
---|
30 | .. raw:: latex |
---|
31 | |
---|
32 | \clearpage |
---|
33 | |
---|
34 | .. index:: CONFIGURE_IDLE_TASK_BODY |
---|
35 | |
---|
36 | .. _CONFIGURE_IDLE_TASK_BODY: |
---|
37 | |
---|
38 | CONFIGURE_IDLE_TASK_BODY |
---|
39 | ------------------------ |
---|
40 | |
---|
41 | .. rubric:: CONSTANT: |
---|
42 | |
---|
43 | ``CONFIGURE_IDLE_TASK_BODY`` |
---|
44 | |
---|
45 | .. rubric:: OPTION TYPE: |
---|
46 | |
---|
47 | This configuration option is an initializer define. |
---|
48 | |
---|
49 | .. rubric:: DEFAULT VALUE: |
---|
50 | |
---|
51 | If the :ref:`CONFIGURE_DISABLE_BSP_SETTINGS` configuration option is not defined and |
---|
52 | :c:macro:`BSP_IDLE_TASK_BODY` is provided by the |
---|
53 | :term:`BSP`, then the default value is defined by |
---|
54 | :c:macro:`BSP_IDLE_TASK_BODY`, otherwise the default value is |
---|
55 | ``_CPU_Thread_Idle_body``. |
---|
56 | |
---|
57 | .. rubric:: DESCRIPTION: |
---|
58 | |
---|
59 | The value of this configuration option initializes the IDLE thread body. |
---|
60 | |
---|
61 | .. rubric:: NOTES: |
---|
62 | |
---|
63 | IDLE threads shall not block. A blocking IDLE thread results in undefined |
---|
64 | system behaviour because the scheduler assume that at least one ready thread |
---|
65 | exists. |
---|
66 | |
---|
67 | IDLE threads can be used to initialize the application, see configuration |
---|
68 | option :ref:`CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION`. |
---|
69 | |
---|
70 | The BSP may have knowledge of the specific CPU model, system controller |
---|
71 | logic, and peripheral buses, so a BSP-specific IDLE task may be capable of |
---|
72 | turning components off to save power during extended periods of no task |
---|
73 | activity. |
---|
74 | |
---|
75 | .. rubric:: CONSTRAINTS: |
---|
76 | |
---|
77 | The value of the configuration option shall be defined to a valid function |
---|
78 | pointer of the type ``void *( *idle_body )( uintptr_t )``. |
---|
79 | |
---|
80 | .. Generated from spec:/acfg/if/idle-task-init-appl |
---|
81 | |
---|
82 | .. raw:: latex |
---|
83 | |
---|
84 | \clearpage |
---|
85 | |
---|
86 | .. index:: CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION |
---|
87 | |
---|
88 | .. _CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION: |
---|
89 | |
---|
90 | CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION |
---|
91 | ------------------------------------------- |
---|
92 | |
---|
93 | .. rubric:: CONSTANT: |
---|
94 | |
---|
95 | ``CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION`` |
---|
96 | |
---|
97 | .. rubric:: OPTION TYPE: |
---|
98 | |
---|
99 | This configuration option is a boolean feature define. |
---|
100 | |
---|
101 | .. rubric:: DEFAULT CONFIGURATION: |
---|
102 | |
---|
103 | If this configuration option is undefined, then the user is assumed to |
---|
104 | provide one or more initialization tasks. |
---|
105 | |
---|
106 | .. rubric:: DESCRIPTION: |
---|
107 | |
---|
108 | This configuration option is defined to indicate that the user has configured |
---|
109 | **no** user initialization tasks or threads and that the user provided IDLE |
---|
110 | task will perform application initialization and then transform itself into |
---|
111 | an IDLE task. |
---|
112 | |
---|
113 | .. rubric:: NOTES: |
---|
114 | |
---|
115 | If you use this option be careful, the user IDLE task **cannot** block at all |
---|
116 | during the initialization sequence. Further, once application |
---|
117 | initialization is complete, it shall make itself preemptible and enter an idle |
---|
118 | body loop. |
---|
119 | |
---|
120 | The IDLE task shall run at the lowest priority of all tasks in the system. |
---|
121 | |
---|
122 | If this configuration option is defined, then it is mandatory to configure a |
---|
123 | user IDLE task with the :ref:`CONFIGURE_IDLE_TASK_BODY` configuration option, |
---|
124 | otherwise a compile time error in the configuration file will occur. |
---|
125 | |
---|
126 | The application shall define at least one of the following configuration |
---|
127 | options |
---|
128 | |
---|
129 | * :ref:`CONFIGURE_RTEMS_INIT_TASKS_TABLE`, |
---|
130 | |
---|
131 | * :ref:`CONFIGURE_POSIX_INIT_THREAD_TABLE`, or |
---|
132 | |
---|
133 | * ``CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION`` |
---|
134 | |
---|
135 | otherwise a compile time error in the configuration file will occur. |
---|
136 | |
---|
137 | If no Classic API initialization task and no POSIX API initialization thread |
---|
138 | is configured, then no :ref:`GlobalConstruction` is performed. |
---|
139 | |
---|
140 | .. Generated from spec:/acfg/if/idle-task-stack-size |
---|
141 | |
---|
142 | .. raw:: latex |
---|
143 | |
---|
144 | \clearpage |
---|
145 | |
---|
146 | .. index:: CONFIGURE_IDLE_TASK_STACK_SIZE |
---|
147 | |
---|
148 | .. _CONFIGURE_IDLE_TASK_STACK_SIZE: |
---|
149 | |
---|
150 | CONFIGURE_IDLE_TASK_STACK_SIZE |
---|
151 | ------------------------------ |
---|
152 | |
---|
153 | .. rubric:: CONSTANT: |
---|
154 | |
---|
155 | ``CONFIGURE_IDLE_TASK_STACK_SIZE`` |
---|
156 | |
---|
157 | .. rubric:: OPTION TYPE: |
---|
158 | |
---|
159 | This configuration option is an integer define. |
---|
160 | |
---|
161 | .. rubric:: DEFAULT VALUE: |
---|
162 | |
---|
163 | If the :ref:`CONFIGURE_DISABLE_BSP_SETTINGS` configuration option is not defined and |
---|
164 | :c:macro:`BSP_IDLE_TASK_STACK_SIZE` is provided by the |
---|
165 | :term:`BSP`, then the default value is defined by |
---|
166 | :c:macro:`BSP_IDLE_TASK_STACK_SIZE`, otherwise the default value is |
---|
167 | defined by the :ref:`CONFIGURE_MINIMUM_TASK_STACK_SIZE` configuration option. |
---|
168 | |
---|
169 | .. rubric:: DESCRIPTION: |
---|
170 | |
---|
171 | The value of this configuration option defines the task stack size for an |
---|
172 | IDLE task. |
---|
173 | |
---|
174 | .. rubric:: NOTES: |
---|
175 | |
---|
176 | In SMP configurations, there is one IDLE task per configured processor, see |
---|
177 | :ref:`CONFIGURE_MAXIMUM_PROCESSORS`. |
---|
178 | |
---|
179 | .. rubric:: CONSTRAINTS: |
---|
180 | |
---|
181 | The following constraints apply to this configuration option: |
---|
182 | |
---|
183 | * The value of the configuration option shall be greater than or equal to a |
---|
184 | BSP-specific and application-specific minimum value. |
---|
185 | |
---|
186 | * The value of the configuration option shall be small enough so that the IDLE |
---|
187 | task stack area calculation carried out by ``<rtems/confdefs.h>`` does not |
---|
188 | overflow an integer of type `size_t |
---|
189 | <https://en.cppreference.com/w/c/types/size_t>`_. |
---|
190 | |
---|
191 | .. Generated from spec:/acfg/if/idle-task-storage-size |
---|
192 | |
---|
193 | .. raw:: latex |
---|
194 | |
---|
195 | \clearpage |
---|
196 | |
---|
197 | .. index:: CONFIGURE_IDLE_TASK_STORAGE_SIZE |
---|
198 | .. index:: IDLE task storage size |
---|
199 | |
---|
200 | .. _CONFIGURE_IDLE_TASK_STORAGE_SIZE: |
---|
201 | |
---|
202 | CONFIGURE_IDLE_TASK_STORAGE_SIZE |
---|
203 | -------------------------------- |
---|
204 | |
---|
205 | .. rubric:: CONSTANT: |
---|
206 | |
---|
207 | ``CONFIGURE_IDLE_TASK_STORAGE_SIZE`` |
---|
208 | |
---|
209 | .. rubric:: OPTION TYPE: |
---|
210 | |
---|
211 | This configuration option is an integer define. |
---|
212 | |
---|
213 | .. rubric:: DEFAULT VALUE: |
---|
214 | |
---|
215 | This configuration option has no default value. If it is not specified, then |
---|
216 | the task storage area for each :term:`IDLE task` will allocated |
---|
217 | from the RTEMS Workspace or through a custom IDLE task stack allocator. |
---|
218 | |
---|
219 | .. rubric:: DESCRIPTION: |
---|
220 | |
---|
221 | If this configuration option is specified, then the task storage areas for |
---|
222 | the :term:`IDLE tasks <IDLE task>` are statically allocated by |
---|
223 | ``<rtems/confdefs.h>``. The value of this configuration option defines the |
---|
224 | size in bytes of the task storage area of each IDLE task in the system. |
---|
225 | |
---|
226 | .. rubric:: NOTES: |
---|
227 | |
---|
228 | By default, the IDLE task storage areas are allocated from the RTEMS |
---|
229 | Workspace. Applications which do not want to use a heap allocator can use |
---|
230 | this configuration option to use statically allocated memory for the IDLE |
---|
231 | task storage areas. The task storage area contains the task stack, the |
---|
232 | thread-local storage, and the floating-point context on architectures with a |
---|
233 | separate floating-point context. The size of the thread-local storage area |
---|
234 | is defined at link time or by the :ref:`CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE` |
---|
235 | configuration option. You have to estimate the actual thread-local storage |
---|
236 | size if you want to use this configuration option. If the IDLE task stack |
---|
237 | size would be less than the value defined by the |
---|
238 | :ref:`CONFIGURE_IDLE_TASK_STACK_SIZE` configuration option, for example because the |
---|
239 | thread-local storage size is larger than expected, then the system terminates |
---|
240 | with the :ref:`INTERNAL_ERROR_CORE <FatalErrorSources>` fatal source and the |
---|
241 | :ref:`INTERNAL_ERROR_IDLE_THREAD_STACK_TOO_SMALL <internal_errors>` fatal code during |
---|
242 | system initialization. |
---|
243 | |
---|
244 | The value of this configuration option is passed to |
---|
245 | :ref:`InterfaceRTEMSTASKSTORAGESIZE` by ``<rtems/confdefs.h>`` to determine |
---|
246 | the actual size of the statically allocated area to take |
---|
247 | architecture-specific overheads into account. |
---|
248 | |
---|
249 | The |
---|
250 | |
---|
251 | * ``CONFIGURE_IDLE_TASK_STORAGE_SIZE``, and |
---|
252 | |
---|
253 | * :ref:`CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE` |
---|
254 | |
---|
255 | configuration options are mutually exclusive. |
---|
256 | |
---|
257 | .. rubric:: CONSTRAINTS: |
---|
258 | |
---|
259 | The value of the configuration option shall be greater than or equal to |
---|
260 | :ref:`CONFIGURE_IDLE_TASK_STACK_SIZE`. |
---|