diff options
| author | Telecaster2147 <Telecaster2147+github[bot]@noreply.github.com> | 2026-03-26 04:31:36 +0000 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2026-03-31 10:37:11 +0800 |
| commit | c7122a46b47216a9f0c97096d926fc25addce0ae (patch) | |
| tree | 8a2b6b4960c95ceda2159dc50fafaaf5cbb5988b /src | |
| parent | 7cd7e05ba4179ac3d73fe127c103083a648ae1c4 (diff) | |
style: format code with clang-format [skip ci]
Diffstat (limited to 'src')
| -rw-r--r-- | src/scheduler_comm.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/scheduler_comm.c b/src/scheduler_comm.c index bd51e16777..84ac0a7416 100644 --- a/src/scheduler_comm.c +++ b/src/scheduler_comm.c @@ -11,8 +11,8 @@ * 2025-09-01 Rbb666 Add thread stack overflow hook. */ -#define DBG_TAG "kernel.sched" -#define DBG_LVL DBG_INFO +#define DBG_TAG "kernel.sched" +#define DBG_LVL DBG_INFO #include <rtdbg.h> #include <rtthread.h> @@ -34,7 +34,7 @@ void rt_sched_thread_init_ctx(struct rt_thread *thread, rt_uint32_t tick, rt_uint8_t priority) { /* setup thread status */ - RT_SCHED_CTX(thread).stat = RT_THREAD_INIT; + RT_SCHED_CTX(thread).stat = RT_THREAD_INIT; #ifdef RT_USING_SMP /* not bind on any cpu */ @@ -258,9 +258,9 @@ rt_err_t rt_sched_thread_ready(struct rt_thread *thread) /* remove from suspend list */ rt_list_remove(&RT_THREAD_LIST_NODE(thread)); - #ifdef RT_USING_SMART +#ifdef RT_USING_SMART thread->wakeup_handle.func = RT_NULL; - #endif +#endif /* insert to schedule ready list and remove from susp list */ rt_sched_insert_thread(thread); @@ -297,7 +297,7 @@ rt_err_t rt_sched_tick_increase(rt_tick_t tick) rt_sched_lock(&slvl); - if(RT_SCHED_PRIV(thread).remaining_tick > tick) + if (RT_SCHED_PRIV(thread).remaining_tick > tick) { RT_SCHED_PRIV(thread).remaining_tick -= tick; } @@ -464,7 +464,7 @@ void rt_scheduler_stack_check(struct rt_thread *thread) /* if stack pointer locate in user data section skip stack check. */ if (lwp && ((rt_uint32_t)thread->sp > (rt_uint32_t)lwp->data_entry && - (rt_uint32_t)thread->sp <= (rt_uint32_t)lwp->data_entry + (rt_uint32_t)lwp->data_size)) + (rt_uint32_t)thread->sp <= (rt_uint32_t)lwp->data_entry + (rt_uint32_t)lwp->data_size)) { return; } @@ -479,7 +479,7 @@ void rt_scheduler_stack_check(struct rt_thread *thread) #endif /* ARCH_CPU_STACK_GROWS_UPWARD */ (rt_uintptr_t)thread->sp <= (rt_uintptr_t)thread->stack_addr || (rt_uintptr_t)thread->sp > - (rt_uintptr_t)thread->stack_addr + (rt_uintptr_t)thread->stack_size) + (rt_uintptr_t)thread->stack_addr + (rt_uintptr_t)thread->stack_size) { rt_base_t dummy = 1; rt_err_t hook_result = -RT_ERROR; @@ -496,7 +496,8 @@ void rt_scheduler_stack_check(struct rt_thread *thread) /* If hook handled the overflow successfully, don't enter infinite loop */ if (hook_result != RT_EOK) { - while (dummy); + while (dummy) + ; } } #endif /* RT_USING_HW_STACK_GUARD */ @@ -508,7 +509,7 @@ void rt_scheduler_stack_check(struct rt_thread *thread) #endif { LOG_W("warning: %s stack is close to the top of stack address.\n", - thread->parent.name); + thread->parent.name); } #else #ifndef RT_USING_HW_STACK_GUARD @@ -518,7 +519,7 @@ void rt_scheduler_stack_check(struct rt_thread *thread) #endif { LOG_W("warning: %s stack is close to end of stack address.\n", - thread->parent.name); + thread->parent.name); } #endif /* ARCH_CPU_STACK_GROWS_UPWARD */ } |
