d4eb2c9014
Implemented dynamic thread stacks for CMSIS threads by declaring an array of default sized thread stacks. Allocation cannot be done on the heap as some architectures require strict alignment for stacks so the macro must be used to define the stack to ensure most compatibility. Added a Kconfig variable to limit the number of dynamic threads on the system (they also count towards total CMSIS thread count). This is so a developer can have fine grained control over how many dynamic threads can be allocated because all their stacks must be allocated up front so could use a lot of memory needlessly if oversubscribed. The default value is 0 which effectively disabled dynamic threads but also reduces the memory impact to almost none. Fixed an assert bug where thread_num was being tested against the maximum allowed CMSIS threads - it previous checked for less than or equal which actually (due to when the increment happens) allowed there to be one more thread. The check now correctly uses less than and only allowed up to the defined maximum. Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com> |
||
---|---|---|
.. | ||
cmsis_rtos_v1 | ||
cmsis_rtos_v2 | ||
gui | ||
libc | ||
os | ||
posix | ||
CMakeLists.txt | ||
Kconfig |