Lines Matching refs:thread

74 #include <kern/thread.h>
93 #include <i386/thread.h>
143 thread_t thread);
146 get_exception_state32(thread_t thread, x86_exception_state32_t *es);
149 get_exception_state64(thread_t thread, x86_exception_state64_t *es);
152 get_thread_state32(thread_t thread, x86_thread_state32_t *ts);
155 get_thread_state64(thread_t thread, x86_thread_state64_t *ts);
158 set_thread_state32(thread_t thread, x86_thread_state32_t *ts);
161 set_thread_state64(thread_t thread, x86_thread_state64_t *ts);
330 set_debug_state32(thread_t thread, x86_debug_state32_t *ds)
335 pcb = THREAD_TO_PCB(thread);
364 set_debug_state64(thread_t thread, x86_debug_state64_t *ds)
369 pcb = THREAD_TO_PCB(thread);
381 if (thread->hv_thread_target) {
382 hv_callbacks.volatile_state(thread->hv_thread_target,
404 get_debug_state32(thread_t thread, x86_debug_state32_t *ds)
408 saved_state = thread->machine.ids;
417 get_debug_state64(thread_t thread, x86_debug_state64_t *ds)
421 saved_state = (x86_debug_state64_t *)thread->machine.ids;
445 * Switch to the first thread on a CPU.
460 * Switch to a new thread.
461 * Save the old thread`s kernel state or continuation,
509 * Load the rest of the user state for the new thread
522 thread_t thread,
529 fpu_save_context(thread);
530 PMAP_SWITCH_CONTEXT(thread, processor->idle_thread, cpu_number());
531 return(Shutdown_context(thread, doshutdown, processor));
541 thread_t thread)
548 if (thread->machine.ifps) {
549 (void) fpu_set_fxstate(thread, NULL, x86_FLOAT_STATE64);
551 if (thread == current_thread())
555 if (thread->machine.ids) {
556 zfree(ids_zone, thread->machine.ids);
557 thread->machine.ids = NULL;
596 get_exception_state64(thread_t thread, x86_exception_state64_t *es)
600 saved_state = USER_REGS64(thread);
609 get_exception_state32(thread_t thread, x86_exception_state32_t *es)
613 saved_state = USER_REGS32(thread);
623 set_thread_state32(thread_t thread, x86_thread_state32_t *ts)
627 pal_register_cache_state(thread, DIRTY);
629 saved_state = USER_REGS32(thread);
646 ts->gs = thread->machine.cthread_self ? USER_CTHREAD : NULL_SEG;
686 set_thread_state64(thread_t thread, x86_thread_state64_t *ts)
690 pal_register_cache_state(thread, DIRTY);
692 saved_state = USER_REGS64(thread);
726 get_thread_state32(thread_t thread, x86_thread_state32_t *ts)
730 pal_register_cache_state(thread, VALID);
732 saved_state = USER_REGS32(thread);
754 get_thread_state64(thread_t thread, x86_thread_state64_t *ts)
758 pal_register_cache_state(thread, VALID);
760 saved_state = USER_REGS64(thread);
789 * Set the status of the specified thread.
1128 * Get the status of the specified thread.
1528 thread_t thread,
1536 * This works only for an interrupted kernel thread
1538 if (thread != current_thread() || int_state == NULL)
1684 panic("unknown thread state");
1696 machine_thread_switch_addrmode(thread_t thread)
1700 * - particularly if we're switching the current thread
1708 machine_thread_create(thread, thread->task);
1711 if (thread == current_thread()) {
1713 act_machine_switch_pcb(NULL, thread);
1722 * This is used to set the current thr_act/thread
1726 machine_set_current_thread(thread_t thread)
1728 current_cpu_datap()->cpu_active_thread = thread;
1733 * Perform machine-dependent per-thread initializations
1774 * detach and return a kernel stack from a thread
1778 machine_stack_detach(thread_t thread)
1783 (uintptr_t)thread_tid(thread), thread->priority,
1784 thread->sched_pri, 0,
1787 stack = thread->kernel_stack;
1788 thread->kernel_stack = 0;
1794 * attach a kernel stack to a thread and initialize it
1799 thread_t thread,
1805 (uintptr_t)thread_tid(thread), thread->priority,
1806 thread->sched_pri, 0, 0);
1809 thread->kernel_stack = stack;
1826 * move a stack from old to new thread