13#define DBG_TAG "kernel.sched"
14#define DBG_LVL DBG_INFO
30 rt_sched_thread_init_priv(thread, tick, priority);
135 #ifdef RT_USING_SMART
136 thread->wakeup_handle.func =
RT_NULL;
140 rt_sched_insert_thread(thread);
185 RT_ASSERT(priority < RT_THREAD_PRIORITY_MAX);
192 rt_sched_remove_thread(thread);
198#if RT_THREAD_PRIORITY_MAX > 32
208 rt_sched_insert_thread(thread);
215#if RT_THREAD_PRIORITY_MAX > 32
227#ifdef RT_USING_OVERFLOW_CHECK
228void rt_scheduler_stack_check(
struct rt_thread *thread)
234 struct rt_lwp *lwp = thread ? (
struct rt_lwp *)thread->lwp : 0;
245#ifndef RT_USING_HW_STACK_GUARD
246#ifdef ARCH_CPU_STACK_GROWS_UPWARD
257 LOG_E(
"thread:%s stack overflow\n", thread->parent.name);
262#ifdef ARCH_CPU_STACK_GROWS_UPWARD
263#ifndef RT_USING_HW_STACK_GUARD
269 LOG_W(
"warning: %s stack is close to the top of stack address.\n",
270 thread->parent.name);
273#ifndef RT_USING_HW_STACK_GUARD
279 LOG_W(
"warning: %s stack is close to end of stack address.\n",
280 thread->parent.name);
rt_err_t rt_timer_stop(rt_timer_t timer)
This function will stop the timer
int stat(const char *file, struct stat *buf)
rt_inline void rt_list_remove(rt_list_t *n)
remove node from list.
#define RT_THREAD_STAT_MASK
rt_thread_t rt_thread_self(void)
This function will return self thread object.
#define RT_THREAD_STAT_YIELD
#define RT_THREAD_SUSPEND_MASK
#define RT_SCHED_CTX(thread)
#define RT_SCHED_DEBUG_IS_LOCKED
#define RT_SCHED_PRIV(thread)
#define RT_THREAD_LIST_NODE(thread)
rt_ubase_t rt_sched_lock_level_t
void rt_sched_thread_init_ctx(struct rt_thread *thread, rt_uint32_t tick, rt_uint8_t priority)
rt_uint8_t rt_sched_thread_get_stat(struct rt_thread *thread)
rt_uint8_t rt_sched_thread_get_curr_prio(struct rt_thread *thread)
rt_err_t rt_sched_thread_timer_stop(struct rt_thread *thread)
rt_uint8_t rt_sched_thread_get_init_prio(struct rt_thread *thread)
rt_err_t rt_sched_thread_change_priority(struct rt_thread *thread, rt_uint8_t priority)
Update priority of the target thread
rt_err_t rt_sched_thread_close(struct rt_thread *thread)
rt_err_t rt_sched_thread_ready(struct rt_thread *thread)
rt_uint8_t rt_sched_thread_is_suspended(struct rt_thread *thread)
rt_err_t rt_sched_tick_increase(rt_tick_t tick)
rt_err_t rt_sched_thread_yield(struct rt_thread *thread)
rt_err_t rt_sched_thread_timer_start(struct rt_thread *thread)
rt_err_t rt_sched_lock(rt_sched_lock_level_t *plvl)
rt_err_t rt_sched_unlock(rt_sched_lock_level_t level)
rt_err_t rt_sched_unlock_n_resched(rt_sched_lock_level_t level)
RT_SCHED_THREAD_CTX struct rt_timer thread_timer