Lines Matching refs:thread

47 #include <kern/thread.h>
64 * dependent thread state info.
66 kern_return_t thread_userstack(thread_t thread, int flavor,
111 * Set the current thread entry point.
113 kern_return_t thread_entrypoint(thread_t thread, int flavor,
144 kern_return_t thread_userstackdefault(thread_t thread,
154 * Get the status of the specified thread.
254 * Set the current thread state.
256 kern_return_t machine_thread_set_state(thread_t thread, thread_flavor_t flavor,
288 assert(thread != NULL);
298 thread->machine.user_regs.r[0] = ts->r[0];
299 thread->machine.user_regs.r[1] = ts->r[1];
300 thread->machine.user_regs.r[2] = ts->r[2];
301 thread->machine.user_regs.r[3] = ts->r[3];
302 thread->machine.user_regs.r[4] = ts->r[4];
303 thread->machine.user_regs.r[5] = ts->r[5];
304 thread->machine.user_regs.r[6] = ts->r[6];
305 thread->machine.user_regs.r[7] = ts->r[7];
306 thread->machine.user_regs.r[8] = ts->r[8];
307 thread->machine.user_regs.r[9] = ts->r[9];
308 thread->machine.user_regs.r[10] = ts->r[10];
309 thread->machine.user_regs.r[11] = ts->r[11];
310 thread->machine.user_regs.r[12] = ts->r[12];
311 thread->machine.user_regs.sp = ts->sp;
312 thread->machine.user_regs.lr = ts->lr;
313 thread->machine.user_regs.pc = ts->pc;
314 thread->machine.user_regs.cpsr = sanitise_cpsr(ts->cpsr);
326 thread->machine.vfp_regs.r[i] = fs->r[i];
327 thread->machine.vfp_regs.fpscr = fs->fpscr;
337 thread->machine.es.fsr = es->fsr;
338 thread->machine.es.far = es->far;
339 thread->machine.es.exception = es->exception;
355 void thread_setuserstack(thread_t thread, mach_vm_address_t user_stack)
357 assert(thread);
358 thread->machine.user_regs.sp = CAST_DOWN(unsigned int, user_stack);
366 uint64_t thread_adjuserstack(thread_t thread, int adj)
368 assert(thread);
369 thread->machine.user_regs.sp += adj;
370 return thread->machine.user_regs.sp;
378 void thread_setentrypoint(thread_t thread, uint32_t entry)
380 assert(thread);
381 thread->machine.user_regs.pc = entry;
387 * Set the parent owner of the specified thread.
408 * Save the current thread context, used for the internal uthread structure.
441 * Restore the current thread context, used for the internal uthread structure.
465 * Set the child thread, used in forking.
478 * Set the thread state (used for psynch support).
480 void thread_set_wq_state32(thread_t thread, thread_state_t tstate)
487 saved_state = thread->machine.uss;
488 assert(thread->machine.uss == &thread->machine.user_regs);
492 if (curth != thread) {
494 thread_lock(thread);
510 if (curth != thread) {
511 thread_unlock(thread);