Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / platform / cc13x2_26x2 / FreeRTOSConfig.h
1 /*
2  * FreeRTOS Kernel V10.0.0
3  * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy
6  * of this software and associated documentation files (the "Software"), to
7  * deal in the Software without restriction, including without limitation the
8  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9  * sell copies of the Software, and to permit persons to whom the Software is
10  * furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in
13  * all copies or substantial portions of the Software. If you wish to use our
14  * Amazon FreeRTOS name, please do so in a fair use way that does not cause
15  * confusion.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23  * IN THE SOFTWARE.
24  *
25  * http://www.FreeRTOS.org
26  * http://aws.amazon.com/freertos
27  *
28  * 1 tab == 4 spaces!
29  */
30
31 /******************************************************************************
32     See http://www.freertos.org/a00110.html for an explanation of the
33     definitions contained in this file.
34 ******************************************************************************/
35
36 #ifndef FREERTOS_CONFIG_H
37 #define FREERTOS_CONFIG_H
38
39 /*-----------------------------------------------------------
40  * Application specific definitions.
41  *
42  * These definitions should be adjusted for your particular hardware and
43  * application requirements.
44  *
45  * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
46  * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
47  * http://www.freertos.org/a00110.html
48  *----------------------------------------------------------*/
49
50 /* Constants related to the behaviour or the scheduler. */
51 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
52 #define configTICK_RATE_HZ ((TickType_t) 100000)
53 #define configUSE_PREEMPTION 1
54 #define configUSE_TIME_SLICING 0
55 #define configMAX_PRIORITIES (10UL)
56 #define configIDLE_SHOULD_YIELD 0
57 #define configUSE_16_BIT_TICKS 0 /* Only for 8 and 16-bit hardware. */
58
59 /* Constants that describe the hardware and memory usage. */
60 #define configCPU_CLOCK_HZ ((unsigned long) 48000000)
61 #define configMINIMAL_STACK_SIZE ((unsigned short) 1024)
62 #define configMAX_TASK_NAME_LEN (12)
63
64 /* FreeRTOS heap size is 0 because currently "bget" heap is the
65  only heap available, for both FreeRTOS and application */
66 //#define configTOTAL_HEAP_SIZE           ( ( size_t ) ( 0 ) )
67 #define configTOTAL_HEAP_SIZE ((size_t)(0))
68 #define configSUPPORT_STATIC_ALLOCATION 1
69 #define configAPPLICATION_ALLOCATED_HEAP 1
70
71 /* Default stack size for TI-POSIX threads (in words) */
72 #define configPOSIX_STACK_SIZE ((unsigned short) 1024)
73
74 /* Constants that build features in or out. */
75 #define configUSE_MUTEXES 1
76 #define configUSE_TICKLESS_IDLE 1
77 #define configUSE_APPLICATION_TASK_TAG 1 /* Need by POSIX/pthread */
78 #define configUSE_CO_ROUTINES 0
79 #define configUSE_COUNTING_SEMAPHORES 1
80 #define configUSE_RECURSIVE_MUTEXES 1
81 #define configUSE_QUEUE_SETS 0
82 #define configUSE_TASK_NOTIFICATIONS 1
83
84 /* Constants that define which hook (callback) functions should be used. */
85 #define configUSE_IDLE_HOOK 0
86 #define configUSE_TICK_HOOK 0
87 #define configUSE_MALLOC_FAILED_HOOK 0
88
89 /* Constants provided for debugging and optimisation assistance. */
90 #define configCHECK_FOR_STACK_OVERFLOW 2
91 #define configASSERT(x)                                                                                                            \
92     if ((x) == 0)                                                                                                                  \
93     {                                                                                                                              \
94         taskDISABLE_INTERRUPTS();                                                                                                  \
95         for (;;)                                                                                                                   \
96             ;                                                                                                                      \
97     }
98 #define configQUEUE_REGISTRY_SIZE 0
99
100 /* Minimum FreeRTOS tick periods of idle before invoking Power policy */
101 /* TODO: find way to reduce this; FreeRTOS requires it to be 2 or more */
102 #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2
103
104 /* Software timer definitions. */
105 #define configUSE_TIMERS 1
106 #define configTIMER_TASK_PRIORITY (6)
107 #define configTIMER_QUEUE_LENGTH (20)
108 #define configTIMER_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE * 2)
109
110 #define configENABLE_BACKWARD_COMPATIBILITY 1
111
112 #if defined(__TI_COMPILER_VERSION__) || defined(__ti_version__)
113 #include <ti/posix/freertos/PTLS.h>
114 #define traceTASK_DELETE(pxTCB) PTLS_taskDeleteHook(pxTCB)
115 #elif defined(__IAR_SYSTEMS_ICC__)
116 #ifndef __IAR_SYSTEMS_ASM__
117 #include <ti/posix/freertos/Mtx.h>
118 #define traceTASK_DELETE(pxTCB) Mtx_taskDeleteHook(pxTCB)
119 #endif
120 #endif
121
122 /*
123  *  Enable thread local storage
124  *
125  *  Assign TLS array index ownership here to avoid collisions.
126  *  TLS storage is needed to implement thread-safe errno with
127  *  TI and IAR compilers. With GNU compiler, we enable newlib.
128  */
129 #if defined(__TI_COMPILER_VERSION__) || defined(__ti_version__) || defined(__IAR_SYSTEMS_ICC__)
130
131 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 2
132
133 #if defined(__TI_COMPILER_VERSION__) || defined(__ti_version__)
134 #define PTLS_TLS_INDEX 0 /* ti.posix.freertos.PTLS */
135 #elif defined(__IAR_SYSTEMS_ICC__)
136 #define MTX_TLS_INDEX 0 /* ti.posix.freertos.Mtx */
137 #endif
138
139 #define NDK_TLS_INDEX 1 /* Reserve an index for NDK TLS */
140
141 #elif defined(__GNUC__)
142
143 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 1
144
145 #define NDK_TLS_INDEX 0 /* Reserve an index for NDK TLS */
146
147 /* note: system locks required by newlib are not implemented */
148 #define configUSE_NEWLIB_REENTRANT 1
149 #endif
150
151 /*
152  * Set the following definitions to 1 to include the API function, or zero
153  * to exclude the API function.  NOTE:  Setting an INCLUDE_ parameter to 0 is
154  * only necessary if the linker does not automatically remove functions that
155  * are not referenced anyway.
156  */
157 #define INCLUDE_vTaskPrioritySet 1
158 #define INCLUDE_uxTaskPriorityGet 1
159 #define INCLUDE_vTaskDelete 1
160 #define INCLUDE_vTaskCleanUpResources 0
161 #define INCLUDE_vTaskSuspend 1
162 #define INCLUDE_vTaskDelayUntil 1
163 #define INCLUDE_vTaskDelay 1
164 #define INCLUDE_uxTaskGetStackHighWaterMark 0
165 #define INCLUDE_xTaskGetIdleTaskHandle 0
166 #define INCLUDE_eTaskGetState 1
167 #define INCLUDE_xTaskResumeFromISR 0
168 #define INCLUDE_xTaskGetCurrentTaskHandle 1
169 #define INCLUDE_xTaskGetSchedulerState 1
170 #define INCLUDE_xSemaphoreGetMutexHolder 0
171 #define INCLUDE_xTimerPendFunctionCall 0
172
173 /* Cortex-M3/4 interrupt priority configuration follows...................... */
174
175 /* Use the system definition, if there is one. */
176 #ifdef __NVIC_PRIO_BITS
177 #define configPRIO_BITS __NVIC_PRIO_BITS
178 #else
179 #define configPRIO_BITS 3 /* 8 priority levels */
180 #endif
181
182 /*
183  * The lowest interrupt priority that can be used in a call to a "set priority"
184  * function.
185  */
186 #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x07
187
188 /*
189  * The highest interrupt priority that can be used by any interrupt service
190  * routine that makes calls to interrupt safe FreeRTOS API functions.  DO NOT
191  * CALL INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A
192  * HIGHER PRIORITY THAN THIS! (higher priorities are lower numeric values.
193  */
194 #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 1
195
196 /*
197  * Interrupt priorities used by the kernel port layer itself.  These are generic
198  * to all Cortex-M ports, and do not rely on any particular library functions.
199  */
200 #define configKERNEL_INTERRUPT_PRIORITY (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
201
202 /*
203  * !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
204  * See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html.
205  *
206  * Priority 1 (shifted 5 since only the top 3 bits are implemented).
207  * Priority 1 is the second highest priority.
208  * Priority 0 is the highest priority.
209  */
210 #define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
211
212 /*
213  * The trace facility is turned on to make some functions available for use in
214  * CLI commands.
215  */
216 #define configUSE_TRACE_FACILITY 1
217
218 /*
219  * Runtime Object View is a Texas Instrument host tool that helps visualize
220  * the application. When enabled, the ISR stack will be initialized in the
221  * startup_<device>_<compiler>.c file to 0xa5a5a5a5. The stack peak can then
222  * be displayed in Runtime Object View.
223  */
224 #define configENABLE_ISR_STACK_INIT 1
225
226 #endif /* FREERTOS_CONFIG_H */