Lines Matching refs:to_thread

480     struct rt_thread *to_thread;  in rt_system_scheduler_start()  local
500 to_thread = _scheduler_get_highest_priority_thread(&highest_ready_priority); in rt_system_scheduler_start()
501 RT_ASSERT(to_thread); in rt_system_scheduler_start()
504 _sched_remove_thread_locked(to_thread); in rt_system_scheduler_start()
507 RT_SCHED_CTX(to_thread).oncpu = rt_hw_cpu_id(); in rt_system_scheduler_start()
508 RT_SCHED_CTX(to_thread).stat = RT_THREAD_RUNNING; in rt_system_scheduler_start()
511 rt_hw_cpu_id(), RT_SCHED_PRIV(to_thread).current_priority, in rt_system_scheduler_start()
512 RT_NAME_MAX, to_thread->parent.name, to_thread->sp); in rt_system_scheduler_start()
517 rt_hw_context_switch_to((rt_ubase_t)&to_thread->sp, to_thread); in rt_system_scheduler_start()
611 rt_thread_t to_thread = RT_NULL; in _prepare_context_switch_locked() local
618 to_thread = _scheduler_get_highest_priority_thread(&highest_ready_priority); in _prepare_context_switch_locked()
633 to_thread = current_thread; in _prepare_context_switch_locked()
639 to_thread = current_thread; in _prepare_context_switch_locked()
665 RT_SCHED_CTX(to_thread).oncpu = cpu_id; in _prepare_context_switch_locked()
668 if (to_thread != current_thread) in _prepare_context_switch_locked()
672 RT_OBJECT_HOOK_CALL(rt_scheduler_hook, (current_thread, to_thread)); in _prepare_context_switch_locked()
675 _sched_remove_thread_locked(to_thread); in _prepare_context_switch_locked()
676 …RT_SCHED_CTX(to_thread).stat = RT_THREAD_RUNNING | (RT_SCHED_CTX(to_thread).stat & ~RT_THREAD_STAT… in _prepare_context_switch_locked()
678 RT_SCHEDULER_STACK_CHECK(to_thread); in _prepare_context_switch_locked()
685 to_thread = RT_NULL; in _prepare_context_switch_locked()
691 to_thread = RT_NULL; in _prepare_context_switch_locked()
694 return to_thread; in _prepare_context_switch_locked()
803 struct rt_thread *to_thread; in rt_sched_unlock_n_resched() local
852 to_thread = _prepare_context_switch_locked(cpu_id, pcpu, current_thread); in rt_sched_unlock_n_resched()
853 if (to_thread) in rt_sched_unlock_n_resched()
859 cpu_id, RT_SCHED_PRIV(to_thread).current_priority, in rt_sched_unlock_n_resched()
860 RT_NAME_MAX, to_thread->parent.name, to_thread->sp, in rt_sched_unlock_n_resched()
864 (rt_ubase_t)&to_thread->sp, to_thread); in rt_sched_unlock_n_resched()
899 struct rt_thread *to_thread; in rt_schedule() local
948 to_thread = _prepare_context_switch_locked(cpu_id, pcpu, current_thread); in rt_schedule()
950 if (to_thread) in rt_schedule()
955 cpu_id, RT_SCHED_PRIV(to_thread).current_priority, in rt_schedule()
956 RT_NAME_MAX, to_thread->parent.name, to_thread->sp, in rt_schedule()
960 (rt_ubase_t)&to_thread->sp, to_thread); in rt_schedule()
994 struct rt_thread *to_thread; in rt_scheduler_do_irq_switch() local
1032 to_thread = _prepare_context_switch_locked(cpu_id, pcpu, current_thread); in rt_scheduler_do_irq_switch()
1033 if (to_thread) in rt_scheduler_do_irq_switch()
1038 cpu_id, RT_SCHED_PRIV(to_thread).current_priority, in rt_scheduler_do_irq_switch()
1039 RT_NAME_MAX, to_thread->parent.name, to_thread->sp, in rt_scheduler_do_irq_switch()
1043 (rt_ubase_t)&to_thread->sp, to_thread); in rt_scheduler_do_irq_switch()