Mistake on this page?
Report an issue in GitHub or email us
mbed_rtx_conf.h
1 /* mbed Microcontroller Library
2  * Copyright (c) 2006-2012 ARM Limited
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20  * SOFTWARE.
21  */
22 #ifndef MBED_RTX_CONF_H
23 #define MBED_RTX_CONF_H
24 
25 #include "mbed_rtx.h"
26 
27 /** Any access to RTX5 specific data structures used in common code should be wrapped in ifdef MBED_OS_BACKEND_RTX5 */
28 #define MBED_OS_BACKEND_RTX5
29 
30 #if defined(MBED_CONF_APP_THREAD_STACK_SIZE)
31 #define OS_STACK_SIZE MBED_CONF_APP_THREAD_STACK_SIZE
32 #else
33 #define OS_STACK_SIZE MBED_CONF_RTOS_THREAD_STACK_SIZE
34 #endif
35 
36 #ifdef MBED_CONF_APP_TIMER_THREAD_STACK_SIZE
37 #define OS_TIMER_THREAD_STACK_SIZE MBED_CONF_APP_TIMER_THREAD_STACK_SIZE
38 #else
39 #define OS_TIMER_THREAD_STACK_SIZE MBED_CONF_RTOS_TIMER_THREAD_STACK_SIZE
40 #endif
41 
42 // Increase the idle thread stack size when tickless is enabled
43 #if defined(EXTRA_IDLE_STACK_REQUIRED) || (defined(MBED_TICKLESS) && defined(LPTICKER_DELAY_TICKS) && (LPTICKER_DELAY_TICKS > 0))
44 #define EXTRA_IDLE_STACK MBED_CONF_RTOS_IDLE_THREAD_STACK_SIZE_TICKLESS_EXTRA
45 #else
46 #define EXTRA_IDLE_STACK 0
47 #endif
48 
49 // Increase the idle thread stack size when debug is enabled
50 #if defined(MBED_DEBUG) || defined(MBED_ALL_STATS_ENABLED)
51 #define EXTRA_IDLE_STACK_DEBUG MBED_CONF_RTOS_IDLE_THREAD_STACK_SIZE_DEBUG_EXTRA
52 #else
53 #define EXTRA_IDLE_STACK_DEBUG 0
54 #endif
55 
56 #ifdef MBED_CONF_APP_IDLE_THREAD_STACK_SIZE
57 #define OS_IDLE_THREAD_STACK_SIZE MBED_CONF_APP_IDLE_THREAD_STACK_SIZE
58 #else
59 #define OS_IDLE_THREAD_STACK_SIZE (MBED_CONF_RTOS_IDLE_THREAD_STACK_SIZE + EXTRA_IDLE_STACK + EXTRA_IDLE_STACK_DEBUG)
60 #endif
61 
62 #define OS_DYNAMIC_MEM_SIZE 0
63 
64 #if defined(OS_TICK_FREQ) && (OS_TICK_FREQ != 1000)
65 #error "OS Tickrate must be 1000 for system timing"
66 #endif
67 
68 #if !defined(OS_STACK_WATERMARK) && (defined(MBED_STACK_STATS_ENABLED) || defined(MBED_ALL_STATS_ENABLED))
69 #define OS_STACK_WATERMARK 1
70 #endif
71 
72 #if !defined(OS_STACK_WATERMARK) && defined(MBED_THREAD_STATS_ENABLED)
73 #define OS_STACK_WATERMARK 1
74 #endif
75 
76 
77 #define OS_IDLE_THREAD_TZ_MOD_ID 1
78 #define OS_TIMER_THREAD_TZ_MOD_ID 1
79 
80 
81 // Don't adopt default multi-thread support for ARM/ARMC6 toolchains from RTX code base.
82 // Provide Mbed-specific instead.
83 #define RTX_NO_MULTITHREAD_CLIB
84 // LIBSPACE default value set for ARMCC
85 #define OS_THREAD_LIBSPACE_NUM 4
86 
87 #define OS_IDLE_THREAD_NAME "rtx_idle"
88 #define OS_TIMER_THREAD_NAME "rtx_timer"
89 
90 /* Enable only the evr events we use in Mbed-OS to save flash space. */
91 //Following events are used by Mbed-OS, DO NOT disable them
92 //#define EVR_RTX_KERNEL_ERROR_DISABLE
93 //#define EVR_RTX_THREAD_ERROR_DISABLE
94 //#define EVR_RTX_THREAD_EXIT_DISABLE
95 //#define EVR_RTX_THREAD_TERMINATE_DISABLE
96 //#define EVR_RTX_TIMER_ERROR_DISABLE
97 //#define EVR_RTX_EVENT_FLAGS_ERROR_DISABLE
98 //#define EVR_RTX_MUTEX_ERROR_DISABLE
99 //#define EVR_RTX_SEMAPHORE_ERROR_DISABLE
100 //#define EVR_RTX_MEMORY_POOL_ERROR_DISABLE
101 //#define EVR_RTX_MESSAGE_QUEUE_ERROR_DISABLE
102 
103 //Following events are NOT used by Mbed-OS, you may enable them if needed for debug purposes
104 #define EVR_RTX_MEMORY_INIT_DISABLE
105 #define EVR_RTX_MEMORY_ALLOC_DISABLE
106 #define EVR_RTX_MEMORY_FREE_DISABLE
107 #define EVR_RTX_MEMORY_BLOCK_INIT_DISABLE
108 #define EVR_RTX_MEMORY_BLOCK_ALLOC_DISABLE
109 #define EVR_RTX_MEMORY_BLOCK_FREE_DISABLE
110 #define EVR_RTX_KERNEL_INITIALIZE_DISABLE
111 #define EVR_RTX_KERNEL_INITIALIZED_DISABLE
112 #define EVR_RTX_KERNEL_GET_INFO_DISABLE
113 #define EVR_RTX_KERNEL_INFO_RETRIEVED_DISABLE
114 #define EVR_RTX_KERNEL_GET_STATE_DISABLE
115 #define EVR_RTX_KERNEL_START_DISABLE
116 #define EVR_RTX_KERNEL_STARTED_DISABLE
117 #define EVR_RTX_KERNEL_LOCK_DISABLE
118 #define EVR_RTX_KERNEL_LOCKED_DISABLE
119 #define EVR_RTX_KERNEL_UNLOCK_DISABLE
120 #define EVR_RTX_KERNEL_UNLOCKED_DISABLE
121 #define EVR_RTX_KERNEL_RESTORE_LOCK_DISABLE
122 #define EVR_RTX_KERNEL_LOCK_RESTORED_DISABLE
123 #define EVR_RTX_KERNEL_SUSPEND_DISABLE
124 #define EVR_RTX_KERNEL_SUSPENDED_DISABLE
125 #define EVR_RTX_KERNEL_RESUME_DISABLE
126 #define EVR_RTX_KERNEL_RESUMED_DISABLE
127 #define EVR_RTX_KERNEL_GET_TICK_COUNT_DISABLE
128 #define EVR_RTX_KERNEL_GET_TICK_FREQ_DISABLE
129 #define EVR_RTX_KERNEL_GET_SYS_TIMER_COUNT_DISABLE
130 #define EVR_RTX_KERNEL_GET_SYS_TIMER_FREQ_DISABLE
131 #define EVR_RTX_THREAD_NEW_DISABLE
132 #define EVR_RTX_THREAD_CREATED_DISABLE
133 #define EVR_RTX_THREAD_GET_NAME_DISABLE
134 #define EVR_RTX_THREAD_GET_ID_DISABLE
135 #define EVR_RTX_THREAD_GET_STATE_DISABLE
136 #define EVR_RTX_THREAD_GET_STACK_SIZE_DISABLE
137 #define EVR_RTX_THREAD_GET_STACK_SPACE_DISABLE
138 #define EVR_RTX_THREAD_SET_PRIORITY_DISABLE
139 #define EVR_RTX_THREAD_GET_PRIORITY_DISABLE
140 #define EVR_RTX_THREAD_YIELD_DISABLE
141 #define EVR_RTX_THREAD_SUSPEND_DISABLE
142 #define EVR_RTX_THREAD_SUSPENDED_DISABLE
143 #define EVR_RTX_THREAD_RESUME_DISABLE
144 #define EVR_RTX_THREAD_RESUMED_DISABLE
145 #define EVR_RTX_THREAD_DETACH_DISABLE
146 #define EVR_RTX_THREAD_DETACHED_DISABLE
147 #define EVR_RTX_THREAD_JOIN_DISABLE
148 #define EVR_RTX_THREAD_JOIN_PENDING_DISABLE
149 #define EVR_RTX_THREAD_JOINED_DISABLE
150 #define EVR_RTX_THREAD_BLOCKED_DISABLE
151 #define EVR_RTX_THREAD_UNBLOCKED_DISABLE
152 #define EVR_RTX_THREAD_PREEMPTED_DISABLE
153 #define EVR_RTX_THREAD_SWITCHED_DISABLE
154 #define EVR_RTX_THREAD_DESTROYED_DISABLE
155 #define EVR_RTX_THREAD_GET_COUNT_DISABLE
156 #define EVR_RTX_THREAD_ENUMERATE_DISABLE
157 #define EVR_RTX_THREAD_FLAGS_SET_DISABLE
158 #define EVR_RTX_THREAD_FLAGS_SET_DONE_DISABLE
159 #define EVR_RTX_THREAD_FLAGS_CLEAR_DISABLE
160 #define EVR_RTX_THREAD_FLAGS_CLEAR_DONE_DISABLE
161 #define EVR_RTX_THREAD_FLAGS_GET_DISABLE
162 #define EVR_RTX_THREAD_FLAGS_WAIT_DISABLE
163 #define EVR_RTX_THREAD_FLAGS_WAIT_PENDING_DISABLE
164 #define EVR_RTX_THREAD_FLAGS_WAIT_TIMEOUT_DISABLE
165 #define EVR_RTX_THREAD_FLAGS_WAIT_COMPLETED_DISABLE
166 #define EVR_RTX_THREAD_FLAGS_WAIT_NOT_COMPLETED_DISABLE
167 #define EVR_RTX_DELAY_DISABLE
168 #define EVR_RTX_DELAY_UNTIL_DISABLE
169 #define EVR_RTX_DELAY_STARTED_DISABLE
170 #define EVR_RTX_DELAY_UNTIL_STARTED_DISABLE
171 #define EVR_RTX_DELAY_COMPLETED_DISABLE
172 #define EVR_RTX_TIMER_CALLBACK_DISABLE
173 #define EVR_RTX_TIMER_NEW_DISABLE
174 #define EVR_RTX_TIMER_CREATED_DISABLE
175 #define EVR_RTX_TIMER_GET_NAME_DISABLE
176 #define EVR_RTX_TIMER_START_DISABLE
177 #define EVR_RTX_TIMER_STARTED_DISABLE
178 #define EVR_RTX_TIMER_STOP_DISABLE
179 #define EVR_RTX_TIMER_STOPPED_DISABLE
180 #define EVR_RTX_TIMER_IS_RUNNING_DISABLE
181 #define EVR_RTX_TIMER_DELETE_DISABLE
182 #define EVR_RTX_TIMER_DESTROYED_DISABLE
183 #define EVR_RTX_EVENT_FLAGS_NEW_DISABLE
184 #define EVR_RTX_EVENT_FLAGS_CREATED_DISABLE
185 #define EVR_RTX_EVENT_FLAGS_GET_NAME_DISABLE
186 #define EVR_RTX_EVENT_FLAGS_SET_DISABLE
187 #define EVR_RTX_EVENT_FLAGS_SET_DONE_DISABLE
188 #define EVR_RTX_EVENT_FLAGS_CLEAR_DISABLE
189 #define EVR_RTX_EVENT_FLAGS_CLEAR_DONE_DISABLE
190 #define EVR_RTX_EVENT_FLAGS_GET_DISABLE
191 #define EVR_RTX_EVENT_FLAGS_WAIT_DISABLE
192 #define EVR_RTX_EVENT_FLAGS_WAIT_PENDING_DISABLE
193 #define EVR_RTX_EVENT_FLAGS_WAIT_TIMEOUT_DISABLE
194 #define EVR_RTX_EVENT_FLAGS_WAIT_COMPLETED_DISABLE
195 #define EVR_RTX_EVENT_FLAGS_WAIT_NOT_COMPLETED_DISABLE
196 #define EVR_RTX_EVENT_FLAGS_DELETE_DISABLE
197 #define EVR_RTX_EVENT_FLAGS_DESTROYED_DISABLE
198 #define EVR_RTX_MUTEX_NEW_DISABLE
199 #define EVR_RTX_MUTEX_CREATED_DISABLE
200 #define EVR_RTX_MUTEX_GET_NAME_DISABLE
201 #define EVR_RTX_MUTEX_ACQUIRE_DISABLE
202 #define EVR_RTX_MUTEX_ACQUIRE_PENDING_DISABLE
203 #define EVR_RTX_MUTEX_ACQUIRE_TIMEOUT_DISABLE
204 #define EVR_RTX_MUTEX_ACQUIRED_DISABLE
205 #define EVR_RTX_MUTEX_NOT_ACQUIRED_DISABLE
206 #define EVR_RTX_MUTEX_RELEASE_DISABLE
207 #define EVR_RTX_MUTEX_RELEASED_DISABLE
208 #define EVR_RTX_MUTEX_GET_OWNER_DISABLE
209 #define EVR_RTX_MUTEX_DELETE_DISABLE
210 #define EVR_RTX_MUTEX_DESTROYED_DISABLE
211 #define EVR_RTX_SEMAPHORE_NEW_DISABLE
212 #define EVR_RTX_SEMAPHORE_CREATED_DISABLE
213 #define EVR_RTX_SEMAPHORE_GET_NAME_DISABLE
214 #define EVR_RTX_SEMAPHORE_ACQUIRE_DISABLE
215 #define EVR_RTX_SEMAPHORE_ACQUIRE_PENDING_DISABLE
216 #define EVR_RTX_SEMAPHORE_ACQUIRE_TIMEOUT_DISABLE
217 #define EVR_RTX_SEMAPHORE_ACQUIRED_DISABLE
218 #define EVR_RTX_SEMAPHORE_NOT_ACQUIRED_DISABLE
219 #define EVR_RTX_SEMAPHORE_RELEASE_DISABLE
220 #define EVR_RTX_SEMAPHORE_RELEASED_DISABLE
221 #define EVR_RTX_SEMAPHORE_GET_COUNT_DISABLE
222 #define EVR_RTX_SEMAPHORE_DELETE_DISABLE
223 #define EVR_RTX_SEMAPHORE_DESTROYED_DISABLE
224 #define EVR_RTX_MEMORY_POOL_NEW_DISABLE
225 #define EVR_RTX_MEMORY_POOL_CREATED_DISABLE
226 #define EVR_RTX_MEMORY_POOL_GET_NAME_DISABLE
227 #define EVR_RTX_MEMORY_POOL_ALLOC_DISABLE
228 #define EVR_RTX_MEMORY_POOL_ALLOC_PENDING_DISABLE
229 #define EVR_RTX_MEMORY_POOL_ALLOC_TIMEOUT_DISABLE
230 #define EVR_RTX_MEMORY_POOL_ALLOCATED_DISABLE
231 #define EVR_RTX_MEMORY_POOL_ALLOC_FAILED_DISABLE
232 #define EVR_RTX_MEMORY_POOL_FREE_DISABLE
233 #define EVR_RTX_MEMORY_POOL_DEALLOCATED_DISABLE
234 #define EVR_RTX_MEMORY_POOL_FREE_FAILED_DISABLE
235 #define EVR_RTX_MEMORY_POOL_GET_CAPACITY_DISABLE
236 #define EVR_RTX_MEMORY_POOL_GET_BLOCK_SZIE_DISABLE
237 #define EVR_RTX_MEMORY_POOL_GET_COUNT_DISABLE
238 #define EVR_RTX_MEMORY_POOL_GET_SPACE_DISABLE
239 #define EVR_RTX_MEMORY_POOL_DELETE_DISABLE
240 #define EVR_RTX_MEMORY_POOL_DESTROYED_DISABLE
241 #define EVR_RTX_MESSAGE_QUEUE_NEW_DISABLE
242 #define EVR_RTX_MESSAGE_QUEUE_CREATED_DISABLE
243 #define EVR_RTX_MESSAGE_QUEUE_GET_NAME_DISABLE
244 #define EVR_RTX_MESSAGE_QUEUE_PUT_DISABLE
245 #define EVR_RTX_MESSAGE_QUEUE_PUT_PENDING_DISABLE
246 #define EVR_RTX_MESSAGE_QUEUE_PUT_TIMEOUT_DISABLE
247 #define EVR_RTX_MESSAGE_QUEUE_INSERT_PENDING_DISABLE
248 #define EVR_RTX_MESSAGE_QUEUE_INSERTED_DISABLE
249 #define EVR_RTX_MESSAGE_QUEUE_NOT_INSERTED_DISABLE
250 #define EVR_RTX_MESSAGE_QUEUE_GET_DISABLE
251 #define EVR_RTX_MESSAGE_QUEUE_GET_PENDING_DISABLE
252 #define EVR_RTX_MESSAGE_QUEUE_GET_TIMEOUT_DISABLE
253 #define EVR_RTX_MESSAGE_QUEUE_RETRIEVED_DISABLE
254 #define EVR_RTX_MESSAGE_QUEUE_NOT_RETRIEVED_DISABLE
255 #define EVR_RTX_MESSAGE_QUEUE_GET_CAPACITY_DISABLE
256 #define EVR_RTX_MESSAGE_QUEUE_GET_MSG_SIZE_DISABLE
257 #define EVR_RTX_MESSAGE_QUEUE_GET_COUNT_DISABLE
258 #define EVR_RTX_MESSAGE_QUEUE_GET_SPACE_DISABLE
259 #define EVR_RTX_MESSAGE_QUEUE_RESET_DISABLE
260 #define EVR_RTX_MESSAGE_QUEUE_RESET_DONE_DISABLE
261 #define EVR_RTX_MESSAGE_QUEUE_DELETE_DISABLE
262 #define EVR_RTX_MESSAGE_QUEUE_DESTROYED_DISABLE
263 
264 #endif /* MBED_RTX_CONF_H */
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.