Official mbed Real Time Operating System based on the RTX implementation of the CMSIS-RTOS API open standard.
Dependents: denki-yohou_b TestY201 Network-RTOS NTPClient_HelloWorld ... more
Deprecated
This is the mbed 2 rtos library. mbed OS 5 integrates the mbed library with mbed-rtos. With this, we have provided thread safety for all mbed APIs. If you'd like to learn about using mbed OS 5, please see the docs.
Diff: rtx/TARGET_CORTEX_M/HAL_CM.c
- Revision:
- 120:4dc938e301cc
- Parent:
- 118:6635230e06ba
- Child:
- 123:58563e6cba1e
--- a/rtx/TARGET_CORTEX_M/HAL_CM.c Wed Aug 10 16:09:20 2016 +0100 +++ b/rtx/TARGET_CORTEX_M/HAL_CM.c Thu Aug 18 14:38:56 2016 +0100 @@ -90,32 +90,6 @@ /* Task entry point. */ p_TCB->ptask = task_body; - -#ifdef __MBED_CMSIS_RTOS_CM - /* Set a magic word for checking of stack overflow. - For the main thread (ID: MAIN_THREAD_ID) the stack is in a memory area shared with the - heap, therefore the last word of the stack is a moving target. - We want to do stack/heap collision detection instead. - Similar applies to stack filling for the magic pattern. - */ - if (p_TCB->task_id != MAIN_THREAD_ID) { - p_TCB->stack[0] = MAGIC_WORD; - - /* Initialize stack with magic pattern. */ - if (os_stackinfo & 0x10000000U) { - if (size > (16U+1U)) { - for (i = ((size - 16U)/2U) - 1U; i; i--) { - stk -= 2U; - stk[1] = MAGIC_PATTERN; - stk[0] = MAGIC_PATTERN; - } - if (--stk > p_TCB->stack) { - *stk = MAGIC_PATTERN; - } - } - } - } -#else /* Initialize stack with magic pattern. */ if (os_stackinfo & 0x10000000U) { if (size > (16U+1U)) { @@ -132,7 +106,6 @@ /* Set a magic word for checking of stack overflow. */ p_TCB->stack[0] = MAGIC_WORD; -#endif }