File tree Expand file tree Collapse file tree 3 files changed +0
-47
lines changed Expand file tree Collapse file tree 3 files changed +0
-47
lines changed Original file line number Diff line number Diff line change @@ -90,32 +90,6 @@ void rt_init_stack (P_TCB p_TCB, FUNCP task_body) {
90
90
/* Task entry point. */
91
91
p_TCB -> ptask = task_body ;
92
92
93
-
94
- #ifdef __MBED_CMSIS_RTOS_CM
95
- /* Set a magic word for checking of stack overflow.
96
- For the main thread (ID: MAIN_THREAD_ID) the stack is in a memory area shared with the
97
- heap, therefore the last word of the stack is a moving target.
98
- We want to do stack/heap collision detection instead.
99
- Similar applies to stack filling for the magic pattern.
100
- */
101
- if (p_TCB -> task_id != MAIN_THREAD_ID ) {
102
- p_TCB -> stack [0 ] = MAGIC_WORD ;
103
-
104
- /* Initialize stack with magic pattern. */
105
- if (os_stackinfo & 0x10000000U ) {
106
- if (size > (16U + 1U )) {
107
- for (i = ((size - 16U )/2U ) - 1U ; i ; i -- ) {
108
- stk -= 2U ;
109
- stk [1 ] = MAGIC_PATTERN ;
110
- stk [0 ] = MAGIC_PATTERN ;
111
- }
112
- if (-- stk > p_TCB -> stack ) {
113
- * stk = MAGIC_PATTERN ;
114
- }
115
- }
116
- }
117
- }
118
- #else
119
93
/* Initialize stack with magic pattern. */
120
94
if (os_stackinfo & 0x10000000U ) {
121
95
if (size > (16U + 1U )) {
@@ -132,7 +106,6 @@ void rt_init_stack (P_TCB p_TCB, FUNCP task_body) {
132
106
133
107
/* Set a magic word for checking of stack overflow. */
134
108
p_TCB -> stack [0 ] = MAGIC_WORD ;
135
- #endif
136
109
}
137
110
138
111
Original file line number Diff line number Diff line change 80
80
#define OS_TIMERS 0
81
81
#endif
82
82
83
- /* If os timers macro is set to 0, there's no timer thread created, therefore
84
- * main thread has tid 0x01
85
- */
86
- #if defined(OS_TIMERS ) && (OS_TIMERS == 0 )
87
- #define MAIN_THREAD_ID 0x01
88
- #else
89
- #define MAIN_THREAD_ID 0x02
90
- #endif
91
83
#endif
92
84
93
85
#define DEFAULT_STACK_SIZE (WORDS_STACK_SIZE*4)
Original file line number Diff line number Diff line change @@ -313,22 +313,10 @@ void rt_systick (void) {
313
313
/*--------------------------- rt_stk_check ----------------------------------*/
314
314
315
315
__weak void rt_stk_check (void ) {
316
- #ifdef __MBED_CMSIS_RTOS_CM
317
- /* Check for stack overflow. */
318
- if (os_tsk .run -> task_id == MAIN_THREAD_ID ) {
319
- // TODO: For the main thread the check should be done against the main heap pointer
320
- } else {
321
- if ((os_tsk .run -> tsk_stack < (U32 )os_tsk .run -> stack ) ||
322
- (os_tsk .run -> stack [0 ] != MAGIC_WORD )) {
323
- os_error (OS_ERR_STK_OVF );
324
- }
325
- }
326
- #else
327
316
if ((os_tsk .run -> tsk_stack < (U32 )os_tsk .run -> stack ) ||
328
317
(os_tsk .run -> stack [0 ] != MAGIC_WORD )) {
329
318
os_error (OS_ERR_STK_OVF );
330
319
}
331
- #endif
332
320
}
333
321
334
322
/*----------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments