1 /**************************************************************************/ 2 /* */ 3 /* Copyright (c) Microsoft Corporation. All rights reserved. */ 4 /* */ 5 /* This software is licensed under the Microsoft Software License */ 6 /* Terms for Microsoft Azure RTOS. Full text of the license can be */ 7 /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ 8 /* and in the root directory of this software. */ 9 /* */ 10 /**************************************************************************/ 11 12 13 /**************************************************************************/ 14 /**************************************************************************/ 15 /** */ 16 /** ThreadX Component */ 17 /** */ 18 /** User Specific */ 19 /** */ 20 /**************************************************************************/ 21 /**************************************************************************/ 22 23 24 /**************************************************************************/ 25 /* */ 26 /* PORT SPECIFIC C INFORMATION RELEASE */ 27 /* */ 28 /* tx_user.h PORTABLE C */ 29 /* 6.0.1 */ 30 /* */ 31 /* AUTHOR */ 32 /* */ 33 /* William E. Lamie, Microsoft Corporation */ 34 /* */ 35 /* DESCRIPTION */ 36 /* */ 37 /* This file contains user defines for configuring ThreadX in specific */ 38 /* ways. This file will have an effect only if the application and */ 39 /* ThreadX library are built with TX_INCLUDE_USER_DEFINE_FILE defined. */ 40 /* Note that all the defines in this file may also be made on the */ 41 /* command line when building ThreadX library and application objects. */ 42 /* */ 43 /* RELEASE HISTORY */ 44 /* */ 45 /* DATE NAME DESCRIPTION */ 46 /* */ 47 /* 06-30-2020 William E. Lamie Initial Version 6.0.1 */ 48 /* */ 49 /**************************************************************************/ 50 51 #ifndef TX_USER_H 52 #define TX_USER_H 53 54 55 /* Define various build options for the ThreadX port. The application should either make changes 56 here by commenting or un-commenting the conditional compilation defined OR supply the defines 57 though the compiler's equivalent of the -D option. 58 59 For maximum speed, the following should be defined: 60 61 TX_MAX_PRIORITIES 32 62 TX_DISABLE_PREEMPTION_THRESHOLD 63 TX_DISABLE_REDUNDANT_CLEARING 64 TX_DISABLE_NOTIFY_CALLBACKS 65 TX_NOT_INTERRUPTABLE 66 TX_TIMER_PROCESS_IN_ISR 67 TX_REACTIVATE_INLINE 68 TX_DISABLE_STACK_FILLING 69 TX_INLINE_THREAD_RESUME_SUSPEND 70 71 For minimum size, the following should be defined: 72 73 TX_MAX_PRIORITIES 32 74 TX_DISABLE_PREEMPTION_THRESHOLD 75 TX_DISABLE_REDUNDANT_CLEARING 76 TX_DISABLE_NOTIFY_CALLBACKS 77 TX_NOT_INTERRUPTABLE 78 TX_TIMER_PROCESS_IN_ISR 79 80 Of course, many of these defines reduce functionality and/or change the behavior of the 81 system in ways that may not be worth the trade-off. For example, the TX_TIMER_PROCESS_IN_ISR 82 results in faster and smaller code, however, it increases the amount of processing in the ISR. 83 In addition, some services that are available in timers are not available from ISRs and will 84 therefore return an error if this option is used. This may or may not be desirable for a 85 given application. */ 86 87 88 /* Override various options with default values already assigned in tx_port.h. Please also refer 89 to tx_port.h for descriptions on each of these options. */ 90 91 /* 92 #define TX_MAX_PRIORITIES 32 93 #define TX_MINIMUM_STACK ???? 94 #define TX_THREAD_USER_EXTENSION ???? 95 #define TX_TIMER_THREAD_STACK_SIZE ???? 96 #define TX_TIMER_THREAD_PRIORITY ???? 97 */ 98 99 /* Determine if timer expirations (application timers, timeouts, and tx_thread_sleep calls 100 should be processed within the a system timer thread or directly in the timer ISR. 101 By default, the timer thread is used. When the following is defined, the timer expiration 102 processing is done directly from the timer ISR, thereby eliminating the timer thread control 103 block, stack, and context switching to activate it. */ 104 105 /* 106 #define TX_TIMER_PROCESS_IN_ISR 107 */ 108 109 /* Determine if in-line timer reactivation should be used within the timer expiration processing. 110 By default, this is disabled and a function call is used. When the following is defined, 111 reactivating is performed in-line resulting in faster timer processing but slightly larger 112 code size. */ 113 114 /* 115 #define TX_REACTIVATE_INLINE 116 */ 117 118 /* Determine is stack filling is enabled. By default, ThreadX stack filling is enabled, 119 which places an 0xEF pattern in each byte of each thread's stack. This is used by 120 debuggers with ThreadX-awareness and by the ThreadX run-time stack checking feature. */ 121 122 /* 123 #define TX_DISABLE_STACK_FILLING 124 */ 125 126 /* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is 127 disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack 128 checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING 129 define is negated, thereby forcing the stack fill which is necessary for the stack checking 130 logic. */ 131 132 /* 133 #define TX_ENABLE_STACK_CHECKING 134 */ 135 136 /* Determine if preemption-threshold should be disabled. By default, preemption-threshold is 137 enabled. If the application does not use preemption-threshold, it may be disabled to reduce 138 code size and improve performance. */ 139 140 /* 141 #define TX_DISABLE_PREEMPTION_THRESHOLD 142 */ 143 144 /* Determine if global ThreadX variables should be cleared. If the compiler startup code clears 145 the .bss section prior to ThreadX running, the define can be used to eliminate unnecessary 146 clearing of ThreadX global variables. */ 147 148 /* 149 #define TX_DISABLE_REDUNDANT_CLEARING 150 */ 151 152 /* Determine if no timer processing is required. This option will help eliminate the timer 153 processing when not needed. The user will also have to comment out the call to 154 tx_timer_interrupt, which is typically made from assembly language in 155 tx_initialize_low_level. Note: if TX_NO_TIMER is used, the define TX_TIMER_PROCESS_IN_ISR 156 must also be used. */ 157 158 /* 159 #define TX_NO_TIMER 160 #ifndef TX_TIMER_PROCESS_IN_ISR 161 #define TX_TIMER_PROCESS_IN_ISR 162 #endif 163 */ 164 165 /* Determine if the notify callback option should be disabled. By default, notify callbacks are 166 enabled. If the application does not use notify callbacks, they may be disabled to reduce 167 code size and improve performance. */ 168 169 /* 170 #define TX_DISABLE_NOTIFY_CALLBACKS 171 */ 172 173 174 /* Determine if the tx_thread_resume and tx_thread_suspend services should have their internal 175 code in-line. This results in a larger image, but improves the performance of the thread 176 resume and suspend services. */ 177 178 /* 179 #define TX_INLINE_THREAD_RESUME_SUSPEND 180 */ 181 182 183 /* Determine if the internal ThreadX code is non-interruptable. This results in smaller code 184 size and less processing overhead, but increases the interrupt lockout time. */ 185 186 /* 187 #define TX_NOT_INTERRUPTABLE 188 */ 189 190 191 /* Determine if the trace event logging code should be enabled. This causes slight increases in 192 code size and overhead, but provides the ability to generate system trace information which 193 is available for viewing in TraceX. */ 194 195 /* 196 #define TX_ENABLE_EVENT_TRACE 197 */ 198 199 200 /* Determine if block pool performance gathering is required by the application. When the following is 201 defined, ThreadX gathers various block pool performance information. */ 202 203 /* 204 #define TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO 205 */ 206 207 /* Determine if byte pool performance gathering is required by the application. When the following is 208 defined, ThreadX gathers various byte pool performance information. */ 209 210 /* 211 #define TX_BYTE_POOL_ENABLE_PERFORMANCE_INFO 212 */ 213 214 /* Determine if event flags performance gathering is required by the application. When the following is 215 defined, ThreadX gathers various event flags performance information. */ 216 217 /* 218 #define TX_EVENT_FLAGS_ENABLE_PERFORMANCE_INFO 219 */ 220 221 /* Determine if mutex performance gathering is required by the application. When the following is 222 defined, ThreadX gathers various mutex performance information. */ 223 224 /* 225 #define TX_MUTEX_ENABLE_PERFORMANCE_INFO 226 */ 227 228 /* Determine if queue performance gathering is required by the application. When the following is 229 defined, ThreadX gathers various queue performance information. */ 230 231 /* 232 #define TX_QUEUE_ENABLE_PERFORMANCE_INFO 233 */ 234 235 /* Determine if semaphore performance gathering is required by the application. When the following is 236 defined, ThreadX gathers various semaphore performance information. */ 237 238 /* 239 #define TX_SEMAPHORE_ENABLE_PERFORMANCE_INFO 240 */ 241 242 /* Determine if thread performance gathering is required by the application. When the following is 243 defined, ThreadX gathers various thread performance information. */ 244 245 /* 246 #define TX_THREAD_ENABLE_PERFORMANCE_INFO 247 */ 248 249 /* Determine if timer performance gathering is required by the application. When the following is 250 defined, ThreadX gathers various timer performance information. */ 251 252 /* 253 #define TX_TIMER_ENABLE_PERFORMANCE_INFO 254 */ 255 256 #endif 257 258