diff options
| author | Bernard Xiong <[email protected]> | 2018-11-20 23:13:45 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-11-20 23:13:45 +0800 |
| commit | 46dae3f35f5cc44664a26ebd87803156033a166a (patch) | |
| tree | 47f132d0a7472768deabd2add67d990c0c6e64e7 /src/scheduler.c | |
| parent | b31888de49408b212d2aeab4b40b2a672b958313 (diff) | |
| parent | 6b6d122e3673ca64d2171d3daf1ae940edfa699a (diff) | |
Merge branch 'master' into dev-4.0.x
Diffstat (limited to 'src/scheduler.c')
| -rw-r--r-- | src/scheduler.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/scheduler.c b/src/scheduler.c index 446b153e1b..fd068a6671 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -91,11 +91,19 @@ static void _rt_scheduler_stack_check(struct rt_thread *thread) level = rt_hw_interrupt_disable(); while (level); } +#if defined(ARCH_CPU_STACK_GROWS_UPWARD) + else if ((rt_ubase_t)thread->sp > ((rt_ubase_t)thread->stack_addr + thread->stack_size)) + { + rt_kprintf("warning: %s stack is close to the top of stack address.\n", + thread->name); + } +#else else if ((rt_ubase_t)thread->sp <= ((rt_ubase_t)thread->stack_addr + 32)) { - rt_kprintf("warning: %s stack is close to end of stack address.\n", + rt_kprintf("warning: %s stack is close to the bottom of stack address.\n", thread->name); } +#endif } #endif |
