mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-21 18:57:16 +08:00
Merge branch 'master' into dev-4.0.x
This commit is contained in:
@@ -136,9 +136,15 @@ static rt_err_t _rt_thread_init(struct rt_thread *thread,
|
||||
|
||||
/* init thread stack */
|
||||
rt_memset(thread->stack_addr, '#', thread->stack_size);
|
||||
#ifdef ARCH_CPU_STACK_GROWS_UPWARD
|
||||
thread->sp = (void *)rt_hw_stack_init(thread->entry, thread->parameter,
|
||||
(void *)((char *)thread->stack_addr),
|
||||
(void *)rt_thread_exit);
|
||||
#else
|
||||
thread->sp = (void *)rt_hw_stack_init(thread->entry, thread->parameter,
|
||||
(void *)((char *)thread->stack_addr + thread->stack_size - sizeof(rt_ubase_t)),
|
||||
(void *)rt_thread_exit);
|
||||
#endif
|
||||
|
||||
/* priority init */
|
||||
RT_ASSERT(priority < RT_THREAD_PRIORITY_MAX);
|
||||
|
||||
Reference in New Issue
Block a user