37#if RT_THREAD_PRIORITY_MAX > 32
57#ifdef ARCH_USING_HW_THREAD_SELF
71#define RT_SCHED_THREAD_CTX struct rt_sched_thread_ctx sched_thread_ctx;
73#define RT_SCHED_PRIV(thread) ((thread)->sched_thread_ctx.sched_thread_priv)
74#define RT_SCHED_CTX(thread) ((thread)->sched_thread_ctx)
80#define RT_THREAD_LIST_NODE_ENTRY(node) \
82 rt_list_entry((node), struct rt_sched_thread_ctx, thread_list_node), \
83 struct rt_thread, sched_thread_ctx)
84#define RT_THREAD_LIST_NODE(thread) (RT_SCHED_CTX(thread).thread_list_node)
99#define RT_SCHED_DEBUG_IS_LOCKED do { RT_ASSERT(rt_sched_is_locked()); } while (0)
100#define RT_SCHED_DEBUG_IS_UNLOCKED do { RT_ASSERT(!rt_sched_is_locked()); } while (0)
104#define RT_SCHED_DEBUG_IS_LOCKED
105#define RT_SCHED_DEBUG_IS_UNLOCKED
112#if defined(__RT_KERNEL_SOURCE__) || defined(__RT_IPC_SOURCE__)
117void rt_sched_thread_startup(
struct rt_thread *thread);
120void rt_sched_post_ctx_switch(
struct rt_thread *thread);
136void rt_sched_insert_thread(
struct rt_thread *thread);
137void rt_sched_remove_thread(
struct rt_thread *thread);
138struct rt_thread *rt_sched_thread_self(
void);
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_bool_t rt_sched_is_locked(void)
rt_err_t rt_sched_unlock_n_resched(rt_sched_lock_level_t level)
rt_uint8_t rt_sched_thread_status_t
rt_ubase_t rt_sched_lock_level_t
struct rt_list_node rt_list_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_list_t thread_list_node
struct rt_sched_thread_priv sched_thread_priv
rt_uint8_t sched_flag_ttmr_set
rt_uint8_t sched_flag_locked
rt_uint8_t current_priority