2 * Copyright 2017-2019 NXP
\r
3 * All rights reserved.
\r
6 * SPDX-License-Identifier: BSD-3-Clause
\r
9 /* freertos_tasks_c_additions.h Rev. 1.3 */
\r
10 #ifndef FREERTOS_TASKS_C_ADDITIONS_H
\r
11 #define FREERTOS_TASKS_C_ADDITIONS_H
\r
15 #if (configUSE_TRACE_FACILITY == 0)
\r
16 #error "configUSE_TRACE_FACILITY must be enabled"
\r
19 #define FREERTOS_DEBUG_CONFIG_MAJOR_VERSION 1
\r
20 #define FREERTOS_DEBUG_CONFIG_MINOR_VERSION 3
\r
23 * Default to a FreeRTOS version which didn't include these macros. FreeRTOS
\r
24 * v7.5.3 is used here.
\r
26 #ifndef tskKERNEL_VERSION_BUILD
\r
27 #define tskKERNEL_VERSION_BUILD 3
\r
29 #ifndef tskKERNEL_VERSION_MINOR
\r
30 #define tskKERNEL_VERSION_MINOR 5
\r
32 #ifndef tskKERNEL_VERSION_MAJOR
\r
33 #define tskKERNEL_VERSION_MAJOR 7
\r
37 * The configFRTOS_MEMORY_SCHEME macro describes the heap scheme using a value
\r
38 * 1 - 5 which corresponds to the following schemes:
\r
40 * heap_1 - the very simplest, does not permit memory to be freed
\r
41 * heap_2 - permits memory to be freed, but not does coalescence adjacent free
\r
43 * heap_3 - simply wraps the standard malloc() and free() for thread safety
\r
44 * heap_4 - coalesces adjacent free blocks to avoid fragmentation. Includes
\r
45 * absolute address placement option
\r
46 * heap_5 - as per heap_4, with the ability to span the heap across
\r
47 * multiple nonOadjacent memory areas
\r
49 #ifndef configFRTOS_MEMORY_SCHEME
\r
50 #define configFRTOS_MEMORY_SCHEME 3 /* thread safe malloc */
\r
53 #if ((configFRTOS_MEMORY_SCHEME > 5) || (configFRTOS_MEMORY_SCHEME < 1))
\r
54 #error "Invalid configFRTOS_MEMORY_SCHEME setting!"
\r
61 extern const uint8_t FreeRTOSDebugConfig[];
\r
64 * IAR documentation is confusing. It suggests the data must be statically
\r
65 * linked, and the #pragma placed immediately before the symbol definition.
\r
66 * The IAR supplied examples violate both "rules", so this is a best guess.
\r
69 #if (tskKERNEL_VERSION_MAJOR >= 10) && (tskKERNEL_VERSION_MINOR >= 2)
\r
70 #if defined(__GNUC__)
\r
71 char *const portArch_Name __attribute__((section(".rodata"))) = portARCH_NAME;
\r
72 #elif defined(__CC_ARM) || defined(__ARMCC_VERSION)
\r
73 char *const portArch_Name __attribute__((used)) = portARCH_NAME;
\r
74 #elif defined(__IAR_SYSTEMS_ICC__)
\r
75 char *const portArch_Name = portARCH_NAME;
\r
76 #pragma required=portArch_Name
\r
79 char *const portArch_Name = NULL;
\r
80 #endif // tskKERNEL_VERSION_MAJOR
\r
82 #if defined(__GNUC__)
\r
83 const uint8_t FreeRTOSDebugConfig[] __attribute__((section(".rodata"))) =
\r
84 #elif defined(__CC_ARM) || defined(__ARMCC_VERSION)
\r
85 const uint8_t FreeRTOSDebugConfig[] __attribute__((used)) =
\r
86 #elif defined(__IAR_SYSTEMS_ICC__)
\r
87 #pragma required=FreeRTOSDebugConfig
\r
88 const uint8_t FreeRTOSDebugConfig[] =
\r
91 FREERTOS_DEBUG_CONFIG_MAJOR_VERSION,
\r
92 FREERTOS_DEBUG_CONFIG_MINOR_VERSION,
\r
93 tskKERNEL_VERSION_MAJOR,
\r
94 tskKERNEL_VERSION_MINOR,
\r
95 tskKERNEL_VERSION_BUILD,
\r
96 configFRTOS_MEMORY_SCHEME,
\r
97 offsetof(struct tskTaskControlBlock, pxTopOfStack),
\r
98 #if (tskKERNEL_VERSION_MAJOR > 8)
\r
99 offsetof(struct tskTaskControlBlock, xStateListItem),
\r
101 offsetof(struct tskTaskControlBlock, xGenericListItem),
\r
103 offsetof(struct tskTaskControlBlock, xEventListItem),
\r
104 offsetof(struct tskTaskControlBlock, pxStack),
\r
105 offsetof(struct tskTaskControlBlock, pcTaskName),
\r
106 offsetof(struct tskTaskControlBlock, uxTCBNumber),
\r
107 offsetof(struct tskTaskControlBlock, uxTaskNumber),
\r
108 configMAX_TASK_NAME_LEN,
\r
109 configMAX_PRIORITIES,
\r
112 configENABLE_TRUSTZONE,
\r
113 configRUN_FREERTOS_SECURE_ONLY,
\r
115 0, 0, 0, 0 // padding
\r
122 #endif // FREERTOS_TASKS_C_ADDITIONS_H
\r