mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-08-20 21:29:42 +08:00
1 RT_THREAD_CTRL_BIND_CPU define to 4
2 RTM_EXPORT(rt_cpus_lock_status_restore) 3 sync ARCH_CPU_STACK_GROWS_UPWARD in _rt_scheduler_stack_check()
This commit is contained in:
@@ -86,6 +86,6 @@ void rt_cpus_lock_status_restore(struct rt_thread *thread)
|
||||
rt_hw_spin_unlock(&_cpus_lock);
|
||||
}
|
||||
}
|
||||
RTM_EXPORT(rt_post_switch);
|
||||
RTM_EXPORT(rt_cpus_lock_status_restore);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -99,11 +99,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",
|
||||
thread->name);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user