Lines Matching refs:newthread
431 thread_t *newthread; in get_top_thread() local
438 list_for_every_entry(&run_queue[next_queue], newthread, thread_t, queue_node) { in get_top_thread()
440 if (newthread->pinned_cpu < 0 || newthread->pinned_cpu == cpu) in get_top_thread()
443 list_delete(&newthread->queue_node); in get_top_thread()
448 return newthread; in get_top_thread()
470 thread_t *newthread; in thread_resched() local
481 newthread = get_top_thread(cpu); in thread_resched()
483 DEBUG_ASSERT(newthread); in thread_resched()
485 newthread->state = THREAD_RUNNING; in thread_resched()
489 if (newthread == oldthread) in thread_resched()
493 if (newthread->remaining_quantum <= 0) { in thread_resched()
494 newthread->remaining_quantum = 5; // XXX make this smarter in thread_resched()
499 thread_set_curr_cpu(newthread, cpu); in thread_resched()
502 if (thread_is_idle(newthread)) { in thread_resched()
508 if (thread_is_realtime(newthread)) { in thread_resched()
522 if (thread_is_idle(newthread)) { in thread_resched()
527 KEVLOG_THREAD_SWITCH(oldthread, newthread); in thread_resched()
530 if (thread_is_real_time_or_idle(newthread)) { in thread_resched()
536 cpu, oldthread, oldthread->name, newthread, newthread->name); in thread_resched()
545 cpu, oldthread, oldthread->name, newthread, newthread->name); in thread_resched()
552 target_set_debug_led(0, !thread_is_idle(newthread)); in thread_resched()
555 set_current_thread(newthread); in thread_resched()
560 oldthread->flags, newthread, newthread->name, in thread_resched()
561 newthread->priority, newthread->flags); in thread_resched()
582 uthread_context_switch(oldthread, newthread); in thread_resched()
587 if (newthread->aspace != oldthread->aspace) { in thread_resched()
588 vmm_context_switch(oldthread->aspace, newthread->aspace); in thread_resched()
593 arch_context_switch(oldthread, newthread); in thread_resched()