Skip to content

Commit c059503

Browse files
authored
Merge pull request #2063 from jesven/fix_smp
fix_smp
2 parents 5405345 + b3e1507 commit c059503

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

include/rtdef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ typedef siginfo_t rt_siginfo_t;
500500
#define RT_THREAD_CTRL_CLOSE 0x01 /**< Close thread. */
501501
#define RT_THREAD_CTRL_CHANGE_PRIORITY 0x02 /**< Change thread priority. */
502502
#define RT_THREAD_CTRL_INFO 0x03 /**< Get thread information. */
503-
#define RT_THREAD_CTRL_BIND_CPU 0x03 /**< Set thread bind cpu. */
503+
#define RT_THREAD_CTRL_BIND_CPU 0x04 /**< Set thread bind cpu. */
504504

505505
#ifdef RT_USING_SMP
506506

src/cpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,6 @@ void rt_cpus_lock_status_restore(struct rt_thread *thread)
8686
rt_hw_spin_unlock(&_cpus_lock);
8787
}
8888
}
89-
RTM_EXPORT(rt_post_switch);
89+
RTM_EXPORT(rt_cpus_lock_status_restore);
9090

9191
#endif

src/scheduler.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,19 @@ static void _rt_scheduler_stack_check(struct rt_thread *thread)
9999
level = rt_hw_interrupt_disable();
100100
while (level);
101101
}
102+
#if defined(ARCH_CPU_STACK_GROWS_UPWARD)
103+
else if ((rt_ubase_t)thread->sp > ((rt_ubase_t)thread->stack_addr + thread->stack_size))
104+
{
105+
rt_kprintf("warning: %s stack is close to the top of stack address.\n",
106+
thread->name);
107+
}
108+
#else
102109
else if ((rt_ubase_t)thread->sp <= ((rt_ubase_t)thread->stack_addr + 32))
103110
{
104111
rt_kprintf("warning: %s stack is close to end of stack address.\n",
105112
thread->name);
106113
}
114+
#endif
107115
}
108116
#endif
109117

0 commit comments

Comments
 (0)