zephyr/lib/cmsis_rtos_v2
Carlos Stuart d4eb2c9014 lib: cmsis_rtos_v2: Dynamic thread stacks
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>
2019-02-06 10:20:17 -05:00
..
CMakeLists.txt lib/cmsis_rtos_v2: Implement support for Thread Flags APIs 2018-12-20 12:23:22 +01:00
Kconfig lib: cmsis_rtos_v2: Dynamic thread stacks 2019-02-06 10:20:17 -05:00
event_flags.c lib: cmsis_rtos_v2: Uncrustify source files 2019-02-06 10:20:17 -05:00
kernel.c lib: cmsis_rtos_v2: Uncrustify source files 2019-02-06 10:20:17 -05:00
mempool.c lib: cmsis_rtos_v2: Dynamic memory pools 2019-02-06 10:20:17 -05:00
msgq.c lib: cmsis_rtos_v2: Message queue checks 2019-02-06 10:20:17 -05:00
mutex.c lib: cmsis_rtos_v2: Uncrustify source files 2019-02-06 10:20:17 -05:00
semaphore.c lib: cmsis_rtos_v2: Uncrustify source files 2019-02-06 10:20:17 -05:00
thread.c lib: cmsis_rtos_v2: Dynamic thread stacks 2019-02-06 10:20:17 -05:00
thread_flags.c lib: cmsis_rtos_v2: Uncrustify source files 2019-02-06 10:20:17 -05:00
timer.c lib: cmsis_rtos_v2: Uncrustify source files 2019-02-06 10:20:17 -05:00
wrapper.h lib: cmsis_rtos_v2: Dynamic memory pools 2019-02-06 10:20:17 -05:00