]> begriffs open source - freertos/blob - include/FreeRTOS.h
Place privileged symbols correctly (#84)
[freertos] / include / FreeRTOS.h
1 /*\r
2  * FreeRTOS Kernel V10.3.1\r
3  * Copyright (C) 2020 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
4  *\r
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
6  * this software and associated documentation files (the "Software"), to deal in\r
7  * the Software without restriction, including without limitation the rights to\r
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
9  * the Software, and to permit persons to whom the Software is furnished to do so,\r
10  * subject to the following conditions:\r
11  *\r
12  * The above copyright notice and this permission notice shall be included in all\r
13  * copies or substantial portions of the Software.\r
14  *\r
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
21  *\r
22  * http://www.FreeRTOS.org\r
23  * http://aws.amazon.com/freertos\r
24  *\r
25  * 1 tab == 4 spaces!\r
26  */\r
27 \r
28 #ifndef INC_FREERTOS_H\r
29     #define INC_FREERTOS_H\r
30 \r
31 /*\r
32  * Include the generic headers required for the FreeRTOS port being used.\r
33  */\r
34     #include <stddef.h>\r
35 \r
36 /*\r
37  * If stdint.h cannot be located then:\r
38  *   + If using GCC ensure the -nostdint options is *not* being used.\r
39  *   + Ensure the project's include path includes the directory in which your\r
40  *     compiler stores stdint.h.\r
41  *   + Set any compiler options necessary for it to support C99, as technically\r
42  *     stdint.h is only mandatory with C99 (FreeRTOS does not require C99 in any\r
43  *     other way).\r
44  *   + The FreeRTOS download includes a simple stdint.h definition that can be\r
45  *     used in cases where none is provided by the compiler.  The files only\r
46  *     contains the typedefs required to build FreeRTOS.  Read the instructions\r
47  *     in FreeRTOS/source/stdint.readme for more information.\r
48  */\r
49     #include <stdint.h> /* READ COMMENT ABOVE. */\r
50 \r
51     #ifdef __cplusplus\r
52         extern "C" {\r
53     #endif\r
54 \r
55 /* Application specific configuration options. */\r
56     #include "FreeRTOSConfig.h"\r
57 \r
58 /* Basic FreeRTOS definitions. */\r
59     #include "projdefs.h"\r
60 \r
61 /* Definitions specific to the port being used. */\r
62     #include "portable.h"\r
63 \r
64 /* Must be defaulted before configUSE_NEWLIB_REENTRANT is used below. */\r
65     #ifndef configUSE_NEWLIB_REENTRANT\r
66         #define configUSE_NEWLIB_REENTRANT    0\r
67     #endif\r
68 \r
69 /* Required if struct _reent is used. */\r
70     #if ( configUSE_NEWLIB_REENTRANT == 1 )\r
71         #include <reent.h>\r
72     #endif\r
73 \r
74 /*\r
75  * Check all the required application specific macros have been defined.\r
76  * These macros are application specific and (as downloaded) are defined\r
77  * within FreeRTOSConfig.h.\r
78  */\r
79 \r
80     #ifndef configMINIMAL_STACK_SIZE\r
81         #error Missing definition:  configMINIMAL_STACK_SIZE must be defined in FreeRTOSConfig.h.  configMINIMAL_STACK_SIZE defines the size (in words) of the stack allocated to the idle task.  Refer to the demo project provided for your port for a suitable value.\r
82     #endif\r
83 \r
84     #ifndef configMAX_PRIORITIES\r
85         #error Missing definition:  configMAX_PRIORITIES must be defined in FreeRTOSConfig.h.  See the Configuration section of the FreeRTOS API documentation for details.\r
86     #endif\r
87 \r
88     #if configMAX_PRIORITIES < 1\r
89         #error configMAX_PRIORITIES must be defined to be greater than or equal to 1.\r
90     #endif\r
91 \r
92     #ifndef configUSE_PREEMPTION\r
93         #error Missing definition:  configUSE_PREEMPTION must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
94     #endif\r
95 \r
96     #ifndef configUSE_IDLE_HOOK\r
97         #error Missing definition:  configUSE_IDLE_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
98     #endif\r
99 \r
100     #ifndef configUSE_TICK_HOOK\r
101         #error Missing definition:  configUSE_TICK_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
102     #endif\r
103 \r
104     #ifndef configUSE_16_BIT_TICKS\r
105         #error Missing definition:  configUSE_16_BIT_TICKS must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
106     #endif\r
107 \r
108     #ifndef configUSE_CO_ROUTINES\r
109         #define configUSE_CO_ROUTINES    0\r
110     #endif\r
111 \r
112     #ifndef INCLUDE_vTaskPrioritySet\r
113         #define INCLUDE_vTaskPrioritySet    0\r
114     #endif\r
115 \r
116     #ifndef INCLUDE_uxTaskPriorityGet\r
117         #define INCLUDE_uxTaskPriorityGet    0\r
118     #endif\r
119 \r
120     #ifndef INCLUDE_vTaskDelete\r
121         #define INCLUDE_vTaskDelete    0\r
122     #endif\r
123 \r
124     #ifndef INCLUDE_vTaskSuspend\r
125         #define INCLUDE_vTaskSuspend    0\r
126     #endif\r
127 \r
128     #ifndef INCLUDE_vTaskDelayUntil\r
129         #define INCLUDE_vTaskDelayUntil    0\r
130     #endif\r
131 \r
132     #ifndef INCLUDE_vTaskDelay\r
133         #define INCLUDE_vTaskDelay    0\r
134     #endif\r
135 \r
136     #ifndef INCLUDE_xTaskGetIdleTaskHandle\r
137         #define INCLUDE_xTaskGetIdleTaskHandle    0\r
138     #endif\r
139 \r
140     #ifndef INCLUDE_xTaskAbortDelay\r
141         #define INCLUDE_xTaskAbortDelay    0\r
142     #endif\r
143 \r
144     #ifndef INCLUDE_xQueueGetMutexHolder\r
145         #define INCLUDE_xQueueGetMutexHolder    0\r
146     #endif\r
147 \r
148     #ifndef INCLUDE_xSemaphoreGetMutexHolder\r
149         #define INCLUDE_xSemaphoreGetMutexHolder    INCLUDE_xQueueGetMutexHolder\r
150     #endif\r
151 \r
152     #ifndef INCLUDE_xTaskGetHandle\r
153         #define INCLUDE_xTaskGetHandle    0\r
154     #endif\r
155 \r
156     #ifndef INCLUDE_uxTaskGetStackHighWaterMark\r
157         #define INCLUDE_uxTaskGetStackHighWaterMark    0\r
158     #endif\r
159 \r
160     #ifndef INCLUDE_uxTaskGetStackHighWaterMark2\r
161         #define INCLUDE_uxTaskGetStackHighWaterMark2    0\r
162     #endif\r
163 \r
164     #ifndef INCLUDE_eTaskGetState\r
165         #define INCLUDE_eTaskGetState    0\r
166     #endif\r
167 \r
168     #ifndef INCLUDE_xTaskResumeFromISR\r
169         #define INCLUDE_xTaskResumeFromISR    1\r
170     #endif\r
171 \r
172     #ifndef INCLUDE_xTimerPendFunctionCall\r
173         #define INCLUDE_xTimerPendFunctionCall    0\r
174     #endif\r
175 \r
176     #ifndef INCLUDE_xTaskGetSchedulerState\r
177         #define INCLUDE_xTaskGetSchedulerState    0\r
178     #endif\r
179 \r
180     #ifndef INCLUDE_xTaskGetCurrentTaskHandle\r
181         #define INCLUDE_xTaskGetCurrentTaskHandle    0\r
182     #endif\r
183 \r
184     #if configUSE_CO_ROUTINES != 0\r
185         #ifndef configMAX_CO_ROUTINE_PRIORITIES\r
186             #error configMAX_CO_ROUTINE_PRIORITIES must be greater than or equal to 1.\r
187         #endif\r
188     #endif\r
189 \r
190     #ifndef configUSE_DAEMON_TASK_STARTUP_HOOK\r
191         #define configUSE_DAEMON_TASK_STARTUP_HOOK    0\r
192     #endif\r
193 \r
194     #ifndef configUSE_APPLICATION_TASK_TAG\r
195         #define configUSE_APPLICATION_TASK_TAG    0\r
196     #endif\r
197 \r
198     #ifndef configNUM_THREAD_LOCAL_STORAGE_POINTERS\r
199         #define configNUM_THREAD_LOCAL_STORAGE_POINTERS    0\r
200     #endif\r
201 \r
202     #ifndef configUSE_RECURSIVE_MUTEXES\r
203         #define configUSE_RECURSIVE_MUTEXES    0\r
204     #endif\r
205 \r
206     #ifndef configUSE_MUTEXES\r
207         #define configUSE_MUTEXES    0\r
208     #endif\r
209 \r
210     #ifndef configUSE_TIMERS\r
211         #define configUSE_TIMERS    0\r
212     #endif\r
213 \r
214     #ifndef configUSE_COUNTING_SEMAPHORES\r
215         #define configUSE_COUNTING_SEMAPHORES    0\r
216     #endif\r
217 \r
218     #ifndef configUSE_ALTERNATIVE_API\r
219         #define configUSE_ALTERNATIVE_API    0\r
220     #endif\r
221 \r
222     #ifndef portCRITICAL_NESTING_IN_TCB\r
223         #define portCRITICAL_NESTING_IN_TCB    0\r
224     #endif\r
225 \r
226     #ifndef configMAX_TASK_NAME_LEN\r
227         #define configMAX_TASK_NAME_LEN    16\r
228     #endif\r
229 \r
230     #ifndef configIDLE_SHOULD_YIELD\r
231         #define configIDLE_SHOULD_YIELD    1\r
232     #endif\r
233 \r
234     #if configMAX_TASK_NAME_LEN < 1\r
235         #error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h\r
236     #endif\r
237 \r
238     #ifndef configASSERT\r
239         #define configASSERT( x )\r
240         #define configASSERT_DEFINED    0\r
241     #else\r
242         #define configASSERT_DEFINED    1\r
243     #endif\r
244 \r
245 /* configPRECONDITION should be defined as configASSERT.\r
246  * The CBMC proofs need a way to track assumptions and assertions.\r
247  * A configPRECONDITION statement should express an implicit invariant or\r
248  * assumption made.  A configASSERT statement should express an invariant that must\r
249  * hold explicit before calling the code. */\r
250     #ifndef configPRECONDITION\r
251         #define configPRECONDITION( X )    configASSERT( X )\r
252         #define configPRECONDITION_DEFINED    0\r
253     #else\r
254         #define configPRECONDITION_DEFINED    1\r
255     #endif\r
256 \r
257     #ifndef portMEMORY_BARRIER\r
258         #define portMEMORY_BARRIER()\r
259     #endif\r
260 \r
261     #ifndef portSOFTWARE_BARRIER\r
262         #define portSOFTWARE_BARRIER()\r
263     #endif\r
264 \r
265 /* The timers module relies on xTaskGetSchedulerState(). */\r
266     #if configUSE_TIMERS == 1\r
267 \r
268         #ifndef configTIMER_TASK_PRIORITY\r
269             #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_PRIORITY must also be defined.\r
270         #endif /* configTIMER_TASK_PRIORITY */\r
271 \r
272         #ifndef configTIMER_QUEUE_LENGTH\r
273             #error If configUSE_TIMERS is set to 1 then configTIMER_QUEUE_LENGTH must also be defined.\r
274         #endif /* configTIMER_QUEUE_LENGTH */\r
275 \r
276         #ifndef configTIMER_TASK_STACK_DEPTH\r
277             #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_STACK_DEPTH must also be defined.\r
278         #endif /* configTIMER_TASK_STACK_DEPTH */\r
279 \r
280     #endif /* configUSE_TIMERS */\r
281 \r
282     #ifndef portSET_INTERRUPT_MASK_FROM_ISR\r
283         #define portSET_INTERRUPT_MASK_FROM_ISR()    0\r
284     #endif\r
285 \r
286     #ifndef portCLEAR_INTERRUPT_MASK_FROM_ISR\r
287         #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue )    ( void ) uxSavedStatusValue\r
288     #endif\r
289 \r
290     #ifndef portCLEAN_UP_TCB\r
291         #define portCLEAN_UP_TCB( pxTCB )    ( void ) pxTCB\r
292     #endif\r
293 \r
294     #ifndef portPRE_TASK_DELETE_HOOK\r
295         #define portPRE_TASK_DELETE_HOOK( pvTaskToDelete, pxYieldPending )\r
296     #endif\r
297 \r
298     #ifndef portSETUP_TCB\r
299         #define portSETUP_TCB( pxTCB )    ( void ) pxTCB\r
300     #endif\r
301 \r
302     #ifndef configQUEUE_REGISTRY_SIZE\r
303         #define configQUEUE_REGISTRY_SIZE    0U\r
304     #endif\r
305 \r
306     #if ( configQUEUE_REGISTRY_SIZE < 1 )\r
307         #define vQueueAddToRegistry( xQueue, pcName )\r
308         #define vQueueUnregisterQueue( xQueue )\r
309         #define pcQueueGetName( xQueue )\r
310     #endif\r
311 \r
312     #ifndef portPOINTER_SIZE_TYPE\r
313         #define portPOINTER_SIZE_TYPE    uint32_t\r
314     #endif\r
315 \r
316 /* Remove any unused trace macros. */\r
317     #ifndef traceSTART\r
318 \r
319 /* Used to perform any necessary initialisation - for example, open a file\r
320  * into which trace is to be written. */\r
321         #define traceSTART()\r
322     #endif\r
323 \r
324     #ifndef traceEND\r
325 \r
326 /* Use to close a trace, for example close a file into which trace has been\r
327  * written. */\r
328         #define traceEND()\r
329     #endif\r
330 \r
331     #ifndef traceTASK_SWITCHED_IN\r
332 \r
333 /* Called after a task has been selected to run.  pxCurrentTCB holds a pointer\r
334  * to the task control block of the selected task. */\r
335         #define traceTASK_SWITCHED_IN()\r
336     #endif\r
337 \r
338     #ifndef traceINCREASE_TICK_COUNT\r
339 \r
340 /* Called before stepping the tick count after waking from tickless idle\r
341  * sleep. */\r
342         #define traceINCREASE_TICK_COUNT( x )\r
343     #endif\r
344 \r
345     #ifndef traceLOW_POWER_IDLE_BEGIN\r
346         /* Called immediately before entering tickless idle. */\r
347         #define traceLOW_POWER_IDLE_BEGIN()\r
348     #endif\r
349 \r
350     #ifndef traceLOW_POWER_IDLE_END\r
351         /* Called when returning to the Idle task after a tickless idle. */\r
352         #define traceLOW_POWER_IDLE_END()\r
353     #endif\r
354 \r
355     #ifndef traceTASK_SWITCHED_OUT\r
356 \r
357 /* Called before a task has been selected to run.  pxCurrentTCB holds a pointer\r
358  * to the task control block of the task being switched out. */\r
359         #define traceTASK_SWITCHED_OUT()\r
360     #endif\r
361 \r
362     #ifndef traceTASK_PRIORITY_INHERIT\r
363 \r
364 /* Called when a task attempts to take a mutex that is already held by a\r
365  * lower priority task.  pxTCBOfMutexHolder is a pointer to the TCB of the task\r
366  * that holds the mutex.  uxInheritedPriority is the priority the mutex holder\r
367  * will inherit (the priority of the task that is attempting to obtain the\r
368  * muted. */\r
369         #define traceTASK_PRIORITY_INHERIT( pxTCBOfMutexHolder, uxInheritedPriority )\r
370     #endif\r
371 \r
372     #ifndef traceTASK_PRIORITY_DISINHERIT\r
373 \r
374 /* Called when a task releases a mutex, the holding of which had resulted in\r
375  * the task inheriting the priority of a higher priority task.\r
376  * pxTCBOfMutexHolder is a pointer to the TCB of the task that is releasing the\r
377  * mutex.  uxOriginalPriority is the task's configured (base) priority. */\r
378         #define traceTASK_PRIORITY_DISINHERIT( pxTCBOfMutexHolder, uxOriginalPriority )\r
379     #endif\r
380 \r
381     #ifndef traceBLOCKING_ON_QUEUE_RECEIVE\r
382 \r
383 /* Task is about to block because it cannot read from a\r
384  * queue/mutex/semaphore.  pxQueue is a pointer to the queue/mutex/semaphore\r
385  * upon which the read was attempted.  pxCurrentTCB points to the TCB of the\r
386  * task that attempted the read. */\r
387         #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue )\r
388     #endif\r
389 \r
390     #ifndef traceBLOCKING_ON_QUEUE_PEEK\r
391 \r
392 /* Task is about to block because it cannot read from a\r
393  * queue/mutex/semaphore.  pxQueue is a pointer to the queue/mutex/semaphore\r
394  * upon which the read was attempted.  pxCurrentTCB points to the TCB of the\r
395  * task that attempted the read. */\r
396         #define traceBLOCKING_ON_QUEUE_PEEK( pxQueue )\r
397     #endif\r
398 \r
399     #ifndef traceBLOCKING_ON_QUEUE_SEND\r
400 \r
401 /* Task is about to block because it cannot write to a\r
402  * queue/mutex/semaphore.  pxQueue is a pointer to the queue/mutex/semaphore\r
403  * upon which the write was attempted.  pxCurrentTCB points to the TCB of the\r
404  * task that attempted the write. */\r
405         #define traceBLOCKING_ON_QUEUE_SEND( pxQueue )\r
406     #endif\r
407 \r
408     #ifndef configCHECK_FOR_STACK_OVERFLOW\r
409         #define configCHECK_FOR_STACK_OVERFLOW    0\r
410     #endif\r
411 \r
412     #ifndef configRECORD_STACK_HIGH_ADDRESS\r
413         #define configRECORD_STACK_HIGH_ADDRESS    0\r
414     #endif\r
415 \r
416     #ifndef configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H\r
417         #define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H    0\r
418     #endif\r
419 \r
420 /* The following event macros are embedded in the kernel API calls. */\r
421 \r
422     #ifndef traceMOVED_TASK_TO_READY_STATE\r
423         #define traceMOVED_TASK_TO_READY_STATE( pxTCB )\r
424     #endif\r
425 \r
426     #ifndef tracePOST_MOVED_TASK_TO_READY_STATE\r
427         #define tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB )\r
428     #endif\r
429 \r
430     #ifndef traceQUEUE_CREATE\r
431         #define traceQUEUE_CREATE( pxNewQueue )\r
432     #endif\r
433 \r
434     #ifndef traceQUEUE_CREATE_FAILED\r
435         #define traceQUEUE_CREATE_FAILED( ucQueueType )\r
436     #endif\r
437 \r
438     #ifndef traceCREATE_MUTEX\r
439         #define traceCREATE_MUTEX( pxNewQueue )\r
440     #endif\r
441 \r
442     #ifndef traceCREATE_MUTEX_FAILED\r
443         #define traceCREATE_MUTEX_FAILED()\r
444     #endif\r
445 \r
446     #ifndef traceGIVE_MUTEX_RECURSIVE\r
447         #define traceGIVE_MUTEX_RECURSIVE( pxMutex )\r
448     #endif\r
449 \r
450     #ifndef traceGIVE_MUTEX_RECURSIVE_FAILED\r
451         #define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex )\r
452     #endif\r
453 \r
454     #ifndef traceTAKE_MUTEX_RECURSIVE\r
455         #define traceTAKE_MUTEX_RECURSIVE( pxMutex )\r
456     #endif\r
457 \r
458     #ifndef traceTAKE_MUTEX_RECURSIVE_FAILED\r
459         #define traceTAKE_MUTEX_RECURSIVE_FAILED( pxMutex )\r
460     #endif\r
461 \r
462     #ifndef traceCREATE_COUNTING_SEMAPHORE\r
463         #define traceCREATE_COUNTING_SEMAPHORE()\r
464     #endif\r
465 \r
466     #ifndef traceCREATE_COUNTING_SEMAPHORE_FAILED\r
467         #define traceCREATE_COUNTING_SEMAPHORE_FAILED()\r
468     #endif\r
469 \r
470     #ifndef traceQUEUE_SET_SEND\r
471         #define traceQUEUE_SET_SEND    traceQUEUE_SEND\r
472     #endif\r
473 \r
474     #ifndef traceQUEUE_SEND\r
475         #define traceQUEUE_SEND( pxQueue )\r
476     #endif\r
477 \r
478     #ifndef traceQUEUE_SEND_FAILED\r
479         #define traceQUEUE_SEND_FAILED( pxQueue )\r
480     #endif\r
481 \r
482     #ifndef traceQUEUE_RECEIVE\r
483         #define traceQUEUE_RECEIVE( pxQueue )\r
484     #endif\r
485 \r
486     #ifndef traceQUEUE_PEEK\r
487         #define traceQUEUE_PEEK( pxQueue )\r
488     #endif\r
489 \r
490     #ifndef traceQUEUE_PEEK_FAILED\r
491         #define traceQUEUE_PEEK_FAILED( pxQueue )\r
492     #endif\r
493 \r
494     #ifndef traceQUEUE_PEEK_FROM_ISR\r
495         #define traceQUEUE_PEEK_FROM_ISR( pxQueue )\r
496     #endif\r
497 \r
498     #ifndef traceQUEUE_RECEIVE_FAILED\r
499         #define traceQUEUE_RECEIVE_FAILED( pxQueue )\r
500     #endif\r
501 \r
502     #ifndef traceQUEUE_SEND_FROM_ISR\r
503         #define traceQUEUE_SEND_FROM_ISR( pxQueue )\r
504     #endif\r
505 \r
506     #ifndef traceQUEUE_SEND_FROM_ISR_FAILED\r
507         #define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue )\r
508     #endif\r
509 \r
510     #ifndef traceQUEUE_RECEIVE_FROM_ISR\r
511         #define traceQUEUE_RECEIVE_FROM_ISR( pxQueue )\r
512     #endif\r
513 \r
514     #ifndef traceQUEUE_RECEIVE_FROM_ISR_FAILED\r
515         #define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue )\r
516     #endif\r
517 \r
518     #ifndef traceQUEUE_PEEK_FROM_ISR_FAILED\r
519         #define traceQUEUE_PEEK_FROM_ISR_FAILED( pxQueue )\r
520     #endif\r
521 \r
522     #ifndef traceQUEUE_DELETE\r
523         #define traceQUEUE_DELETE( pxQueue )\r
524     #endif\r
525 \r
526     #ifndef traceTASK_CREATE\r
527         #define traceTASK_CREATE( pxNewTCB )\r
528     #endif\r
529 \r
530     #ifndef traceTASK_CREATE_FAILED\r
531         #define traceTASK_CREATE_FAILED()\r
532     #endif\r
533 \r
534     #ifndef traceTASK_DELETE\r
535         #define traceTASK_DELETE( pxTaskToDelete )\r
536     #endif\r
537 \r
538     #ifndef traceTASK_DELAY_UNTIL\r
539         #define traceTASK_DELAY_UNTIL( x )\r
540     #endif\r
541 \r
542     #ifndef traceTASK_DELAY\r
543         #define traceTASK_DELAY()\r
544     #endif\r
545 \r
546     #ifndef traceTASK_PRIORITY_SET\r
547         #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority )\r
548     #endif\r
549 \r
550     #ifndef traceTASK_SUSPEND\r
551         #define traceTASK_SUSPEND( pxTaskToSuspend )\r
552     #endif\r
553 \r
554     #ifndef traceTASK_RESUME\r
555         #define traceTASK_RESUME( pxTaskToResume )\r
556     #endif\r
557 \r
558     #ifndef traceTASK_RESUME_FROM_ISR\r
559         #define traceTASK_RESUME_FROM_ISR( pxTaskToResume )\r
560     #endif\r
561 \r
562     #ifndef traceTASK_INCREMENT_TICK\r
563         #define traceTASK_INCREMENT_TICK( xTickCount )\r
564     #endif\r
565 \r
566     #ifndef traceTIMER_CREATE\r
567         #define traceTIMER_CREATE( pxNewTimer )\r
568     #endif\r
569 \r
570     #ifndef traceTIMER_CREATE_FAILED\r
571         #define traceTIMER_CREATE_FAILED()\r
572     #endif\r
573 \r
574     #ifndef traceTIMER_COMMAND_SEND\r
575         #define traceTIMER_COMMAND_SEND( xTimer, xMessageID, xMessageValueValue, xReturn )\r
576     #endif\r
577 \r
578     #ifndef traceTIMER_EXPIRED\r
579         #define traceTIMER_EXPIRED( pxTimer )\r
580     #endif\r
581 \r
582     #ifndef traceTIMER_COMMAND_RECEIVED\r
583         #define traceTIMER_COMMAND_RECEIVED( pxTimer, xMessageID, xMessageValue )\r
584     #endif\r
585 \r
586     #ifndef traceMALLOC\r
587         #define traceMALLOC( pvAddress, uiSize )\r
588     #endif\r
589 \r
590     #ifndef traceFREE\r
591         #define traceFREE( pvAddress, uiSize )\r
592     #endif\r
593 \r
594     #ifndef traceEVENT_GROUP_CREATE\r
595         #define traceEVENT_GROUP_CREATE( xEventGroup )\r
596     #endif\r
597 \r
598     #ifndef traceEVENT_GROUP_CREATE_FAILED\r
599         #define traceEVENT_GROUP_CREATE_FAILED()\r
600     #endif\r
601 \r
602     #ifndef traceEVENT_GROUP_SYNC_BLOCK\r
603         #define traceEVENT_GROUP_SYNC_BLOCK( xEventGroup, uxBitsToSet, uxBitsToWaitFor )\r
604     #endif\r
605 \r
606     #ifndef traceEVENT_GROUP_SYNC_END\r
607         #define traceEVENT_GROUP_SYNC_END( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred )    ( void ) xTimeoutOccurred\r
608     #endif\r
609 \r
610     #ifndef traceEVENT_GROUP_WAIT_BITS_BLOCK\r
611         #define traceEVENT_GROUP_WAIT_BITS_BLOCK( xEventGroup, uxBitsToWaitFor )\r
612     #endif\r
613 \r
614     #ifndef traceEVENT_GROUP_WAIT_BITS_END\r
615         #define traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxBitsToWaitFor, xTimeoutOccurred )    ( void ) xTimeoutOccurred\r
616     #endif\r
617 \r
618     #ifndef traceEVENT_GROUP_CLEAR_BITS\r
619         #define traceEVENT_GROUP_CLEAR_BITS( xEventGroup, uxBitsToClear )\r
620     #endif\r
621 \r
622     #ifndef traceEVENT_GROUP_CLEAR_BITS_FROM_ISR\r
623         #define traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear )\r
624     #endif\r
625 \r
626     #ifndef traceEVENT_GROUP_SET_BITS\r
627         #define traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet )\r
628     #endif\r
629 \r
630     #ifndef traceEVENT_GROUP_SET_BITS_FROM_ISR\r
631         #define traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet )\r
632     #endif\r
633 \r
634     #ifndef traceEVENT_GROUP_DELETE\r
635         #define traceEVENT_GROUP_DELETE( xEventGroup )\r
636     #endif\r
637 \r
638     #ifndef tracePEND_FUNC_CALL\r
639         #define tracePEND_FUNC_CALL( xFunctionToPend, pvParameter1, ulParameter2, ret )\r
640     #endif\r
641 \r
642     #ifndef tracePEND_FUNC_CALL_FROM_ISR\r
643         #define tracePEND_FUNC_CALL_FROM_ISR( xFunctionToPend, pvParameter1, ulParameter2, ret )\r
644     #endif\r
645 \r
646     #ifndef traceQUEUE_REGISTRY_ADD\r
647         #define traceQUEUE_REGISTRY_ADD( xQueue, pcQueueName )\r
648     #endif\r
649 \r
650     #ifndef traceTASK_NOTIFY_TAKE_BLOCK\r
651         #define traceTASK_NOTIFY_TAKE_BLOCK( uxIndexToWait )\r
652     #endif\r
653 \r
654     #ifndef traceTASK_NOTIFY_TAKE\r
655         #define traceTASK_NOTIFY_TAKE( uxIndexToWait )\r
656     #endif\r
657 \r
658     #ifndef traceTASK_NOTIFY_WAIT_BLOCK\r
659         #define traceTASK_NOTIFY_WAIT_BLOCK( uxIndexToWait )\r
660     #endif\r
661 \r
662     #ifndef traceTASK_NOTIFY_WAIT\r
663         #define traceTASK_NOTIFY_WAIT( uxIndexToWait )\r
664     #endif\r
665 \r
666     #ifndef traceTASK_NOTIFY\r
667         #define traceTASK_NOTIFY( uxIndexToNotify )\r
668     #endif\r
669 \r
670     #ifndef traceTASK_NOTIFY_FROM_ISR\r
671         #define traceTASK_NOTIFY_FROM_ISR( uxIndexToNotify )\r
672     #endif\r
673 \r
674     #ifndef traceTASK_NOTIFY_GIVE_FROM_ISR\r
675         #define traceTASK_NOTIFY_GIVE_FROM_ISR( uxIndexToNotify )\r
676     #endif\r
677 \r
678     #ifndef traceSTREAM_BUFFER_CREATE_FAILED\r
679         #define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer )\r
680     #endif\r
681 \r
682     #ifndef traceSTREAM_BUFFER_CREATE_STATIC_FAILED\r
683         #define traceSTREAM_BUFFER_CREATE_STATIC_FAILED( xReturn, xIsMessageBuffer )\r
684     #endif\r
685 \r
686     #ifndef traceSTREAM_BUFFER_CREATE\r
687         #define traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xIsMessageBuffer )\r
688     #endif\r
689 \r
690     #ifndef traceSTREAM_BUFFER_DELETE\r
691         #define traceSTREAM_BUFFER_DELETE( xStreamBuffer )\r
692     #endif\r
693 \r
694     #ifndef traceSTREAM_BUFFER_RESET\r
695         #define traceSTREAM_BUFFER_RESET( xStreamBuffer )\r
696     #endif\r
697 \r
698     #ifndef traceBLOCKING_ON_STREAM_BUFFER_SEND\r
699         #define traceBLOCKING_ON_STREAM_BUFFER_SEND( xStreamBuffer )\r
700     #endif\r
701 \r
702     #ifndef traceSTREAM_BUFFER_SEND\r
703         #define traceSTREAM_BUFFER_SEND( xStreamBuffer, xBytesSent )\r
704     #endif\r
705 \r
706     #ifndef traceSTREAM_BUFFER_SEND_FAILED\r
707         #define traceSTREAM_BUFFER_SEND_FAILED( xStreamBuffer )\r
708     #endif\r
709 \r
710     #ifndef traceSTREAM_BUFFER_SEND_FROM_ISR\r
711         #define traceSTREAM_BUFFER_SEND_FROM_ISR( xStreamBuffer, xBytesSent )\r
712     #endif\r
713 \r
714     #ifndef traceBLOCKING_ON_STREAM_BUFFER_RECEIVE\r
715         #define traceBLOCKING_ON_STREAM_BUFFER_RECEIVE( xStreamBuffer )\r
716     #endif\r
717 \r
718     #ifndef traceSTREAM_BUFFER_RECEIVE\r
719         #define traceSTREAM_BUFFER_RECEIVE( xStreamBuffer, xReceivedLength )\r
720     #endif\r
721 \r
722     #ifndef traceSTREAM_BUFFER_RECEIVE_FAILED\r
723         #define traceSTREAM_BUFFER_RECEIVE_FAILED( xStreamBuffer )\r
724     #endif\r
725 \r
726     #ifndef traceSTREAM_BUFFER_RECEIVE_FROM_ISR\r
727         #define traceSTREAM_BUFFER_RECEIVE_FROM_ISR( xStreamBuffer, xReceivedLength )\r
728     #endif\r
729 \r
730     #ifndef configGENERATE_RUN_TIME_STATS\r
731         #define configGENERATE_RUN_TIME_STATS    0\r
732     #endif\r
733 \r
734     #if ( configGENERATE_RUN_TIME_STATS == 1 )\r
735 \r
736         #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS\r
737             #error If configGENERATE_RUN_TIME_STATS is defined then portCONFIGURE_TIMER_FOR_RUN_TIME_STATS must also be defined.  portCONFIGURE_TIMER_FOR_RUN_TIME_STATS should call a port layer function to setup a peripheral timer/counter that can then be used as the run time counter time base.\r
738         #endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */\r
739 \r
740         #ifndef portGET_RUN_TIME_COUNTER_VALUE\r
741             #ifndef portALT_GET_RUN_TIME_COUNTER_VALUE\r
742                 #error If configGENERATE_RUN_TIME_STATS is defined then either portGET_RUN_TIME_COUNTER_VALUE or portALT_GET_RUN_TIME_COUNTER_VALUE must also be defined.  See the examples provided and the FreeRTOS web site for more information.\r
743             #endif /* portALT_GET_RUN_TIME_COUNTER_VALUE */\r
744         #endif /* portGET_RUN_TIME_COUNTER_VALUE */\r
745 \r
746     #endif /* configGENERATE_RUN_TIME_STATS */\r
747 \r
748     #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS\r
749         #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()\r
750     #endif\r
751 \r
752     #ifndef configUSE_MALLOC_FAILED_HOOK\r
753         #define configUSE_MALLOC_FAILED_HOOK    0\r
754     #endif\r
755 \r
756     #ifndef portPRIVILEGE_BIT\r
757         #define portPRIVILEGE_BIT    ( ( UBaseType_t ) 0x00 )\r
758     #endif\r
759 \r
760     #ifndef portYIELD_WITHIN_API\r
761         #define portYIELD_WITHIN_API    portYIELD\r
762     #endif\r
763 \r
764     #ifndef portSUPPRESS_TICKS_AND_SLEEP\r
765         #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime )\r
766     #endif\r
767 \r
768     #ifndef configEXPECTED_IDLE_TIME_BEFORE_SLEEP\r
769         #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP    2\r
770     #endif\r
771 \r
772     #if configEXPECTED_IDLE_TIME_BEFORE_SLEEP < 2\r
773         #error configEXPECTED_IDLE_TIME_BEFORE_SLEEP must not be less than 2\r
774     #endif\r
775 \r
776     #ifndef configUSE_TICKLESS_IDLE\r
777         #define configUSE_TICKLESS_IDLE    0\r
778     #endif\r
779 \r
780     #ifndef configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING\r
781         #define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x )\r
782     #endif\r
783 \r
784     #ifndef configPRE_SLEEP_PROCESSING\r
785         #define configPRE_SLEEP_PROCESSING( x )\r
786     #endif\r
787 \r
788     #ifndef configPOST_SLEEP_PROCESSING\r
789         #define configPOST_SLEEP_PROCESSING( x )\r
790     #endif\r
791 \r
792     #ifndef configUSE_QUEUE_SETS\r
793         #define configUSE_QUEUE_SETS    0\r
794     #endif\r
795 \r
796     #ifndef portTASK_USES_FLOATING_POINT\r
797         #define portTASK_USES_FLOATING_POINT()\r
798     #endif\r
799 \r
800     #ifndef portALLOCATE_SECURE_CONTEXT\r
801         #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize )\r
802     #endif\r
803 \r
804     #ifndef portDONT_DISCARD\r
805         #define portDONT_DISCARD\r
806     #endif\r
807 \r
808     #ifndef configUSE_TIME_SLICING\r
809         #define configUSE_TIME_SLICING    1\r
810     #endif\r
811 \r
812     #ifndef configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS\r
813         #define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS    0\r
814     #endif\r
815 \r
816     #ifndef configUSE_STATS_FORMATTING_FUNCTIONS\r
817         #define configUSE_STATS_FORMATTING_FUNCTIONS    0\r
818     #endif\r
819 \r
820     #ifndef portASSERT_IF_INTERRUPT_PRIORITY_INVALID\r
821         #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID()\r
822     #endif\r
823 \r
824     #ifndef configUSE_TRACE_FACILITY\r
825         #define configUSE_TRACE_FACILITY    0\r
826     #endif\r
827 \r
828     #ifndef mtCOVERAGE_TEST_MARKER\r
829         #define mtCOVERAGE_TEST_MARKER()\r
830     #endif\r
831 \r
832     #ifndef mtCOVERAGE_TEST_DELAY\r
833         #define mtCOVERAGE_TEST_DELAY()\r
834     #endif\r
835 \r
836     #ifndef portASSERT_IF_IN_ISR\r
837         #define portASSERT_IF_IN_ISR()\r
838     #endif\r
839 \r
840     #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION\r
841         #define configUSE_PORT_OPTIMISED_TASK_SELECTION    0\r
842     #endif\r
843 \r
844     #ifndef configAPPLICATION_ALLOCATED_HEAP\r
845         #define configAPPLICATION_ALLOCATED_HEAP    0\r
846     #endif\r
847 \r
848     #ifndef configUSE_TASK_NOTIFICATIONS\r
849         #define configUSE_TASK_NOTIFICATIONS    1\r
850     #endif\r
851 \r
852     #ifndef configTASK_NOTIFICATION_ARRAY_ENTRIES\r
853         #define configTASK_NOTIFICATION_ARRAY_ENTRIES    1\r
854     #endif\r
855 \r
856     #if configTASK_NOTIFICATION_ARRAY_ENTRIES < 1\r
857         #error configTASK_NOTIFICATION_ARRAY_ENTRIES must be at least 1\r
858     #endif\r
859 \r
860     #ifndef configUSE_POSIX_ERRNO\r
861         #define configUSE_POSIX_ERRNO    0\r
862     #endif\r
863 \r
864     #ifndef portTICK_TYPE_IS_ATOMIC\r
865         #define portTICK_TYPE_IS_ATOMIC    0\r
866     #endif\r
867 \r
868     #ifndef configSUPPORT_STATIC_ALLOCATION\r
869         /* Defaults to 0 for backward compatibility. */\r
870         #define configSUPPORT_STATIC_ALLOCATION    0\r
871     #endif\r
872 \r
873     #ifndef configSUPPORT_DYNAMIC_ALLOCATION\r
874         /* Defaults to 1 for backward compatibility. */\r
875         #define configSUPPORT_DYNAMIC_ALLOCATION    1\r
876     #endif\r
877 \r
878     #ifndef configSTACK_DEPTH_TYPE\r
879 \r
880 /* Defaults to uint16_t for backward compatibility, but can be overridden\r
881  * in FreeRTOSConfig.h if uint16_t is too restrictive. */\r
882         #define configSTACK_DEPTH_TYPE    uint16_t\r
883     #endif\r
884 \r
885     #ifndef configMESSAGE_BUFFER_LENGTH_TYPE\r
886 \r
887 /* Defaults to size_t for backward compatibility, but can be overridden\r
888  * in FreeRTOSConfig.h if lengths will always be less than the number of bytes\r
889  * in a size_t. */\r
890         #define configMESSAGE_BUFFER_LENGTH_TYPE    size_t\r
891     #endif\r
892 \r
893 /* Sanity check the configuration. */\r
894     #if ( configUSE_TICKLESS_IDLE != 0 )\r
895         #if ( INCLUDE_vTaskSuspend != 1 )\r
896             #error INCLUDE_vTaskSuspend must be set to 1 if configUSE_TICKLESS_IDLE is not set to 0\r
897         #endif /* INCLUDE_vTaskSuspend */\r
898     #endif /* configUSE_TICKLESS_IDLE */\r
899 \r
900     #if ( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )\r
901         #error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1.\r
902     #endif\r
903 \r
904     #if ( ( configUSE_RECURSIVE_MUTEXES == 1 ) && ( configUSE_MUTEXES != 1 ) )\r
905         #error configUSE_MUTEXES must be set to 1 to use recursive mutexes\r
906     #endif\r
907 \r
908     #ifndef configINITIAL_TICK_COUNT\r
909         #define configINITIAL_TICK_COUNT    0\r
910     #endif\r
911 \r
912     #if ( portTICK_TYPE_IS_ATOMIC == 0 )\r
913 \r
914 /* Either variables of tick type cannot be read atomically, or\r
915  * portTICK_TYPE_IS_ATOMIC was not set - map the critical sections used when\r
916  * the tick count is returned to the standard critical section macros. */\r
917         #define portTICK_TYPE_ENTER_CRITICAL()                      portENTER_CRITICAL()\r
918         #define portTICK_TYPE_EXIT_CRITICAL()                       portEXIT_CRITICAL()\r
919         #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR()         portSET_INTERRUPT_MASK_FROM_ISR()\r
920         #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x )    portCLEAR_INTERRUPT_MASK_FROM_ISR( ( x ) )\r
921     #else\r
922 \r
923 /* The tick type can be read atomically, so critical sections used when the\r
924  * tick count is returned can be defined away. */\r
925         #define portTICK_TYPE_ENTER_CRITICAL()\r
926         #define portTICK_TYPE_EXIT_CRITICAL()\r
927         #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR()         0\r
928         #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x )    ( void ) x\r
929     #endif /* if ( portTICK_TYPE_IS_ATOMIC == 0 ) */\r
930 \r
931 /* Definitions to allow backward compatibility with FreeRTOS versions prior to\r
932  * V8 if desired. */\r
933     #ifndef configENABLE_BACKWARD_COMPATIBILITY\r
934         #define configENABLE_BACKWARD_COMPATIBILITY    1\r
935     #endif\r
936 \r
937     #ifndef configPRINTF\r
938 \r
939 /* configPRINTF() was not defined, so define it away to nothing.  To use\r
940  * configPRINTF() then define it as follows (where MyPrintFunction() is\r
941  * provided by the application writer):\r
942  *\r
943  * void MyPrintFunction(const char *pcFormat, ... );\r
944  #define configPRINTF( X )   MyPrintFunction X\r
945  *\r
946  * Then call like a standard printf() function, but placing brackets around\r
947  * all parameters so they are passed as a single parameter.  For example:\r
948  * configPRINTF( ("Value = %d", MyVariable) ); */\r
949         #define configPRINTF( X )\r
950     #endif\r
951 \r
952     #ifndef configMAX\r
953 \r
954 /* The application writer has not provided their own MAX macro, so define\r
955  * the following generic implementation. */\r
956         #define configMAX( a, b )    ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) )\r
957     #endif\r
958 \r
959     #ifndef configMIN\r
960 \r
961 /* The application writer has not provided their own MAX macro, so define\r
962  * the following generic implementation. */\r
963         #define configMIN( a, b )    ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )\r
964     #endif\r
965 \r
966     #if configENABLE_BACKWARD_COMPATIBILITY == 1\r
967         #define eTaskStateGet                 eTaskGetState\r
968         #define portTickType                  TickType_t\r
969         #define xTaskHandle                   TaskHandle_t\r
970         #define xQueueHandle                  QueueHandle_t\r
971         #define xSemaphoreHandle              SemaphoreHandle_t\r
972         #define xQueueSetHandle               QueueSetHandle_t\r
973         #define xQueueSetMemberHandle         QueueSetMemberHandle_t\r
974         #define xTimeOutType                  TimeOut_t\r
975         #define xMemoryRegion                 MemoryRegion_t\r
976         #define xTaskParameters               TaskParameters_t\r
977         #define xTaskStatusType               TaskStatus_t\r
978         #define xTimerHandle                  TimerHandle_t\r
979         #define xCoRoutineHandle              CoRoutineHandle_t\r
980         #define pdTASK_HOOK_CODE              TaskHookFunction_t\r
981         #define portTICK_RATE_MS              portTICK_PERIOD_MS\r
982         #define pcTaskGetTaskName             pcTaskGetName\r
983         #define pcTimerGetTimerName           pcTimerGetName\r
984         #define pcQueueGetQueueName           pcQueueGetName\r
985         #define vTaskGetTaskInfo              vTaskGetInfo\r
986         #define xTaskGetIdleRunTimeCounter    ulTaskGetIdleRunTimeCounter\r
987 \r
988 /* Backward compatibility within the scheduler code only - these definitions\r
989  * are not really required but are included for completeness. */\r
990         #define tmrTIMER_CALLBACK             TimerCallbackFunction_t\r
991         #define pdTASK_CODE                   TaskFunction_t\r
992         #define xListItem                     ListItem_t\r
993         #define xList                         List_t\r
994 \r
995 /* For libraries that break the list data hiding, and access list structure\r
996  * members directly (which is not supposed to be done). */\r
997         #define pxContainer                   pvContainer\r
998     #endif /* configENABLE_BACKWARD_COMPATIBILITY */\r
999 \r
1000     #if ( configUSE_ALTERNATIVE_API != 0 )\r
1001         #error The alternative API was deprecated some time ago, and was removed in FreeRTOS V9.0 0\r
1002     #endif\r
1003 \r
1004 /* Set configUSE_TASK_FPU_SUPPORT to 0 to omit floating point support even\r
1005  * if floating point hardware is otherwise supported by the FreeRTOS port in use.\r
1006  * This constant is not supported by all FreeRTOS ports that include floating\r
1007  * point support. */\r
1008     #ifndef configUSE_TASK_FPU_SUPPORT\r
1009         #define configUSE_TASK_FPU_SUPPORT    1\r
1010     #endif\r
1011 \r
1012 /* Set configENABLE_MPU to 1 to enable MPU support and 0 to disable it. This is\r
1013  * currently used in ARMv8M ports. */\r
1014     #ifndef configENABLE_MPU\r
1015         #define configENABLE_MPU    0\r
1016     #endif\r
1017 \r
1018 /* Set configENABLE_FPU to 1 to enable FPU support and 0 to disable it. This is\r
1019  * currently used in ARMv8M ports. */\r
1020     #ifndef configENABLE_FPU\r
1021         #define configENABLE_FPU    1\r
1022     #endif\r
1023 \r
1024 /* Set configENABLE_TRUSTZONE to 1 enable TrustZone support and 0 to disable it.\r
1025  * This is currently used in ARMv8M ports. */\r
1026     #ifndef configENABLE_TRUSTZONE\r
1027         #define configENABLE_TRUSTZONE    1\r
1028     #endif\r
1029 \r
1030 /* Set configRUN_FREERTOS_SECURE_ONLY to 1 to run the FreeRTOS ARMv8M port on\r
1031  * the Secure Side only. */\r
1032     #ifndef configRUN_FREERTOS_SECURE_ONLY\r
1033         #define configRUN_FREERTOS_SECURE_ONLY    0\r
1034     #endif\r
1035 \r
1036 /* Sometimes the FreeRTOSConfig.h settings only allow a task to be created using\r
1037  * dynamically allocated RAM, in which case when any task is deleted it is known\r
1038  * that both the task's stack and TCB need to be freed.  Sometimes the\r
1039  * FreeRTOSConfig.h settings only allow a task to be created using statically\r
1040  * allocated RAM, in which case when any task is deleted it is known that neither\r
1041  * the task's stack or TCB should be freed.  Sometimes the FreeRTOSConfig.h\r
1042  * settings allow a task to be created using either statically or dynamically\r
1043  * allocated RAM, in which case a member of the TCB is used to record whether the\r
1044  * stack and/or TCB were allocated statically or dynamically, so when a task is\r
1045  * deleted the RAM that was allocated dynamically is freed again and no attempt is\r
1046  * made to free the RAM that was allocated statically.\r
1047  * tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE is only true if it is possible for a\r
1048  * task to be created using either statically or dynamically allocated RAM.  Note\r
1049  * that if portUSING_MPU_WRAPPERS is 1 then a protected task can be created with\r
1050  * a statically allocated stack and a dynamically allocated TCB.\r
1051  *\r
1052  * The following table lists various combinations of portUSING_MPU_WRAPPERS,\r
1053  * configSUPPORT_DYNAMIC_ALLOCATION and configSUPPORT_STATIC_ALLOCATION and\r
1054  * when it is possible to have both static and dynamic allocation:\r
1055  *  +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+\r
1056  * | MPU | Dynamic | Static |     Available Functions     |       Possible Allocations        | Both Dynamic and | Need Free |\r
1057  * |     |         |        |                             |                                   | Static Possible  |           |\r
1058  * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+\r
1059  * | 0   | 0       | 1      | xTaskCreateStatic           | TCB - Static, Stack - Static      | No               | No        |\r
1060  * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
1061  * | 0   | 1       | 0      | xTaskCreate                 | TCB - Dynamic, Stack - Dynamic    | No               | Yes       |\r
1062  * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
1063  * | 0   | 1       | 1      | xTaskCreate,                | 1. TCB - Dynamic, Stack - Dynamic | Yes              | Yes       |\r
1064  * |     |         |        | xTaskCreateStatic           | 2. TCB - Static, Stack - Static   |                  |           |\r
1065  * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
1066  * | 1   | 0       | 1      | xTaskCreateStatic,          | TCB - Static, Stack - Static      | No               | No        |\r
1067  * |     |         |        | xTaskCreateRestrictedStatic |                                   |                  |           |\r
1068  * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
1069  * | 1   | 1       | 0      | xTaskCreate,                | 1. TCB - Dynamic, Stack - Dynamic | Yes              | Yes       |\r
1070  * |     |         |        | xTaskCreateRestricted       | 2. TCB - Dynamic, Stack - Static  |                  |           |\r
1071  * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
1072  * | 1   | 1       | 1      | xTaskCreate,                | 1. TCB - Dynamic, Stack - Dynamic | Yes              | Yes       |\r
1073  * |     |         |        | xTaskCreateStatic,          | 2. TCB - Dynamic, Stack - Static  |                  |           |\r
1074  * |     |         |        | xTaskCreateRestricted,      | 3. TCB - Static, Stack - Static   |                  |           |\r
1075  * |     |         |        | xTaskCreateRestrictedStatic |                                   |                  |           |\r
1076  * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+\r
1077  */\r
1078     #define tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE                                                                                 \\r
1079     ( ( ( portUSING_MPU_WRAPPERS == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) || \\r
1080       ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) )\r
1081 \r
1082 /*\r
1083  * In line with software engineering best practice, FreeRTOS implements a strict\r
1084  * data hiding policy, so the real structures used by FreeRTOS to maintain the\r
1085  * state of tasks, queues, semaphores, etc. are not accessible to the application\r
1086  * code.  However, if the application writer wants to statically allocate such\r
1087  * an object then the size of the object needs to be know.  Dummy structures\r
1088  * that are guaranteed to have the same size and alignment requirements of the\r
1089  * real objects are used for this purpose.  The dummy list and list item\r
1090  * structures below are used for inclusion in such a dummy structure.\r
1091  */\r
1092     struct xSTATIC_LIST_ITEM\r
1093     {\r
1094         #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
1095             TickType_t xDummy1;\r
1096         #endif\r
1097         TickType_t xDummy2;\r
1098         void * pvDummy3[ 4 ];\r
1099         #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
1100             TickType_t xDummy4;\r
1101         #endif\r
1102     };\r
1103     typedef struct xSTATIC_LIST_ITEM StaticListItem_t;\r
1104 \r
1105 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */\r
1106     struct xSTATIC_MINI_LIST_ITEM\r
1107     {\r
1108         #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
1109             TickType_t xDummy1;\r
1110         #endif\r
1111         TickType_t xDummy2;\r
1112         void * pvDummy3[ 2 ];\r
1113     };\r
1114     typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t;\r
1115 \r
1116 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */\r
1117     typedef struct xSTATIC_LIST\r
1118     {\r
1119         #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
1120             TickType_t xDummy1;\r
1121         #endif\r
1122         UBaseType_t uxDummy2;\r
1123         void * pvDummy3;\r
1124         StaticMiniListItem_t xDummy4;\r
1125         #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
1126             TickType_t xDummy5;\r
1127         #endif\r
1128     } StaticList_t;\r
1129 \r
1130 /*\r
1131  * In line with software engineering best practice, especially when supplying a\r
1132  * library that is likely to change in future versions, FreeRTOS implements a\r
1133  * strict data hiding policy.  This means the Task structure used internally by\r
1134  * FreeRTOS is not accessible to application code.  However, if the application\r
1135  * writer wants to statically allocate the memory required to create a task then\r
1136  * the size of the task object needs to be know.  The StaticTask_t structure\r
1137  * below is provided for this purpose.  Its sizes and alignment requirements are\r
1138  * guaranteed to match those of the genuine structure, no matter which\r
1139  * architecture is being used, and no matter how the values in FreeRTOSConfig.h\r
1140  * are set.  Its contents are somewhat obfuscated in the hope users will\r
1141  * recognise that it would be unwise to make direct use of the structure members.\r
1142  */\r
1143     typedef struct xSTATIC_TCB\r
1144     {\r
1145         void * pxDummy1;\r
1146         #if ( portUSING_MPU_WRAPPERS == 1 )\r
1147             xMPU_SETTINGS xDummy2;\r
1148         #endif\r
1149         StaticListItem_t xDummy3[ 2 ];\r
1150         UBaseType_t uxDummy5;\r
1151         void * pxDummy6;\r
1152         uint8_t ucDummy7[ configMAX_TASK_NAME_LEN ];\r
1153         #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )\r
1154             void * pxDummy8;\r
1155         #endif\r
1156         #if ( portCRITICAL_NESTING_IN_TCB == 1 )\r
1157             UBaseType_t uxDummy9;\r
1158         #endif\r
1159         #if ( configUSE_TRACE_FACILITY == 1 )\r
1160             UBaseType_t uxDummy10[ 2 ];\r
1161         #endif\r
1162         #if ( configUSE_MUTEXES == 1 )\r
1163             UBaseType_t uxDummy12[ 2 ];\r
1164         #endif\r
1165         #if ( configUSE_APPLICATION_TASK_TAG == 1 )\r
1166             void * pxDummy14;\r
1167         #endif\r
1168         #if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )\r
1169             void * pvDummy15[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];\r
1170         #endif\r
1171         #if ( configGENERATE_RUN_TIME_STATS == 1 )\r
1172             uint32_t ulDummy16;\r
1173         #endif\r
1174         #if ( configUSE_NEWLIB_REENTRANT == 1 )\r
1175             struct  _reent xDummy17;\r
1176         #endif\r
1177         #if ( configUSE_TASK_NOTIFICATIONS == 1 )\r
1178             uint32_t ulDummy18[ configTASK_NOTIFICATION_ARRAY_ENTRIES ];\r
1179             uint8_t ucDummy19[ configTASK_NOTIFICATION_ARRAY_ENTRIES ];\r
1180         #endif\r
1181         #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )\r
1182             uint8_t uxDummy20;\r
1183         #endif\r
1184 \r
1185         #if ( INCLUDE_xTaskAbortDelay == 1 )\r
1186             uint8_t ucDummy21;\r
1187         #endif\r
1188         #if ( configUSE_POSIX_ERRNO == 1 )\r
1189             int iDummy22;\r
1190         #endif\r
1191     } StaticTask_t;\r
1192 \r
1193 /*\r
1194  * In line with software engineering best practice, especially when supplying a\r
1195  * library that is likely to change in future versions, FreeRTOS implements a\r
1196  * strict data hiding policy.  This means the Queue structure used internally by\r
1197  * FreeRTOS is not accessible to application code.  However, if the application\r
1198  * writer wants to statically allocate the memory required to create a queue\r
1199  * then the size of the queue object needs to be know.  The StaticQueue_t\r
1200  * structure below is provided for this purpose.  Its sizes and alignment\r
1201  * requirements are guaranteed to match those of the genuine structure, no\r
1202  * matter which architecture is being used, and no matter how the values in\r
1203  * FreeRTOSConfig.h are set.  Its contents are somewhat obfuscated in the hope\r
1204  * users will recognise that it would be unwise to make direct use of the\r
1205  * structure members.\r
1206  */\r
1207     typedef struct xSTATIC_QUEUE\r
1208     {\r
1209         void * pvDummy1[ 3 ];\r
1210 \r
1211         union\r
1212         {\r
1213             void * pvDummy2;\r
1214             UBaseType_t uxDummy2;\r
1215         } u;\r
1216 \r
1217         StaticList_t xDummy3[ 2 ];\r
1218         UBaseType_t uxDummy4[ 3 ];\r
1219         uint8_t ucDummy5[ 2 ];\r
1220 \r
1221         #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )\r
1222             uint8_t ucDummy6;\r
1223         #endif\r
1224 \r
1225         #if ( configUSE_QUEUE_SETS == 1 )\r
1226             void * pvDummy7;\r
1227         #endif\r
1228 \r
1229         #if ( configUSE_TRACE_FACILITY == 1 )\r
1230             UBaseType_t uxDummy8;\r
1231             uint8_t ucDummy9;\r
1232         #endif\r
1233     } StaticQueue_t;\r
1234     typedef StaticQueue_t StaticSemaphore_t;\r
1235 \r
1236 /*\r
1237  * In line with software engineering best practice, especially when supplying a\r
1238  * library that is likely to change in future versions, FreeRTOS implements a\r
1239  * strict data hiding policy.  This means the event group structure used\r
1240  * internally by FreeRTOS is not accessible to application code.  However, if\r
1241  * the application writer wants to statically allocate the memory required to\r
1242  * create an event group then the size of the event group object needs to be\r
1243  * know.  The StaticEventGroup_t structure below is provided for this purpose.\r
1244  * Its sizes and alignment requirements are guaranteed to match those of the\r
1245  * genuine structure, no matter which architecture is being used, and no matter\r
1246  * how the values in FreeRTOSConfig.h are set.  Its contents are somewhat\r
1247  * obfuscated in the hope users will recognise that it would be unwise to make\r
1248  * direct use of the structure members.\r
1249  */\r
1250     typedef struct xSTATIC_EVENT_GROUP\r
1251     {\r
1252         TickType_t xDummy1;\r
1253         StaticList_t xDummy2;\r
1254 \r
1255         #if ( configUSE_TRACE_FACILITY == 1 )\r
1256             UBaseType_t uxDummy3;\r
1257         #endif\r
1258 \r
1259         #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )\r
1260             uint8_t ucDummy4;\r
1261         #endif\r
1262     } StaticEventGroup_t;\r
1263 \r
1264 /*\r
1265  * In line with software engineering best practice, especially when supplying a\r
1266  * library that is likely to change in future versions, FreeRTOS implements a\r
1267  * strict data hiding policy.  This means the software timer structure used\r
1268  * internally by FreeRTOS is not accessible to application code.  However, if\r
1269  * the application writer wants to statically allocate the memory required to\r
1270  * create a software timer then the size of the queue object needs to be know.\r
1271  * The StaticTimer_t structure below is provided for this purpose.  Its sizes\r
1272  * and alignment requirements are guaranteed to match those of the genuine\r
1273  * structure, no matter which architecture is being used, and no matter how the\r
1274  * values in FreeRTOSConfig.h are set.  Its contents are somewhat obfuscated in\r
1275  * the hope users will recognise that it would be unwise to make direct use of\r
1276  * the structure members.\r
1277  */\r
1278     typedef struct xSTATIC_TIMER\r
1279     {\r
1280         void * pvDummy1;\r
1281         StaticListItem_t xDummy2;\r
1282         TickType_t xDummy3;\r
1283         void * pvDummy5;\r
1284         TaskFunction_t pvDummy6;\r
1285         #if ( configUSE_TRACE_FACILITY == 1 )\r
1286             UBaseType_t uxDummy7;\r
1287         #endif\r
1288         uint8_t ucDummy8;\r
1289     } StaticTimer_t;\r
1290 \r
1291 /*\r
1292  * In line with software engineering best practice, especially when supplying a\r
1293  * library that is likely to change in future versions, FreeRTOS implements a\r
1294  * strict data hiding policy.  This means the stream buffer structure used\r
1295  * internally by FreeRTOS is not accessible to application code.  However, if\r
1296  * the application writer wants to statically allocate the memory required to\r
1297  * create a stream buffer then the size of the stream buffer object needs to be\r
1298  * know.  The StaticStreamBuffer_t structure below is provided for this purpose.\r
1299  * Its size and alignment requirements are guaranteed to match those of the\r
1300  * genuine structure, no matter which architecture is being used, and no matter\r
1301  * how the values in FreeRTOSConfig.h are set.  Its contents are somewhat\r
1302  * obfuscated in the hope users will recognise that it would be unwise to make\r
1303  * direct use of the structure members.\r
1304  */\r
1305     typedef struct xSTATIC_STREAM_BUFFER\r
1306     {\r
1307         size_t uxDummy1[ 4 ];\r
1308         void * pvDummy2[ 3 ];\r
1309         uint8_t ucDummy3;\r
1310         #if ( configUSE_TRACE_FACILITY == 1 )\r
1311             UBaseType_t uxDummy4;\r
1312         #endif\r
1313     } StaticStreamBuffer_t;\r
1314 \r
1315 /* Message buffers are built on stream buffers. */\r
1316     typedef StaticStreamBuffer_t StaticMessageBuffer_t;\r
1317 \r
1318     #ifdef __cplusplus\r
1319         }\r
1320     #endif\r
1321 \r
1322 #endif /* INC_FREERTOS_H */\r