Lines Matching refs:thread

32 #include <machine/thread.h>
36 #include <kern/thread.h>
49 #pragma mark **** thread state ****
54 thread_t thread,
62 if (thread->task == kernel_task)
64 /* this properly handles deciding whether or not the thread is 64 bit or not */
65 return machine_thread_get_state(thread, flavor, tstate, count);
72 // the user doesn't care if the thread states are user or kernel, he
73 // just wants the thread state, so we need to determine the proper one
74 // to return, kernel or user, for the given thread.
75 if(thread == current_thread() && current_cpu_datap()->cpu_int_state) {
79 if(USER_STATE(thread) == current_cpu_datap()->cpu_int_state &&
82 return machine_thread_get_state(thread, flavor, tstate, count);
85 return machine_thread_get_kern_state(thread, flavor, tstate, count);
88 // get the user-mode thread state
89 return machine_thread_get_state(thread, flavor, tstate, count);
96 thread_t thread,
103 return machine_thread_set_state(thread, flavor, tstate, count);
219 thread_t thread,
231 uint64_t kernStackMin = thread->kernel_stack;
298 thread_t thread,
309 uint64_t kernStackMin = (uint64_t)thread->kernel_stack;
321 // this is the address where caller lives in the user thread
373 thread_t thread,
379 uint64_t kernStackMin = (uint64_t)thread->kernel_stack;
420 // this is the address where caller lives in the user thread
473 thread_t thread,
480 task_t task = thread->task;
500 if(thread == current_thread() && current_cpu_datap()->cpu_int_state) {
502 * Locate the registers for the interrupted thread, assuming it is
521 if(!thread->kernel_stack) {
525 // Kernel thread not at interrupt context
528 // nofault read of the thread->kernel_stack pointer
529 if(KERN_SUCCESS != chudxnu_kern_read(&kregs, (vm_offset_t)&(thread->kernel_stack), sizeof(void *))) {
539 * not at interrupt context, or tracing a different thread than
542 tagged_regs = USER_STATE(thread);
631 kr = do_kernel_backtrace(thread, kregs, callstack, &bufferIndex, bufferMaxIndex);
659 kr = do_backtrace64(task, thread, regs64, callstack, &bufferIndex,
671 kr = do_backtrace32(task, thread, regs32, callstack, &bufferIndex,
682 kr = do_backtrace64(task, thread, u_regs64, callstack, &bufferIndex,
693 kr = do_backtrace32(task, thread, u_regs32, callstack, &bufferIndex,
708 thread_t thread,
713 return chudxnu_thread_get_callstack64_internal(thread, callstack, count, is_user, !is_user);
718 thread_t thread,
723 return chudxnu_thread_get_callstack64_internal(thread, callstack, count, user_only, 0);