Lines Matching refs:td

216 	struct thread *td;
219 td = curthread;
220 if (td->td_md.md_spinlock_count == 0) {
223 td->td_md.md_spinlock_count = 1;
224 td->td_md.md_saved_pil = pil;
226 td->td_md.md_spinlock_count++;
233 struct thread *td;
236 td = curthread;
238 pil = td->td_md.md_saved_pil;
239 td->td_md.md_spinlock_count--;
240 if (td->td_md.md_spinlock_count == 0)
607 struct thread *td;
615 td = curthread;
616 p = td->td_proc;
621 tf = td->td_frame;
625 CTR4(KTR_SIG, "sendsig: td=%p (%s) catcher=%p sig=%d", td, p->p_comm,
635 sigexit(td, sig);
641 get_mcontext(td, &sf.sf_uc.uc_mcontext, 0);
643 sf.sf_uc.uc_stack = td->td_sigstk;
644 sf.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) ?
648 if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack &&
650 sfp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp +
651 td->td_sigstk.ss_size - sizeof(struct sigframe));
677 if (rwindow_save(td) != 0 || copyout(&sf, sfp, sizeof(*sfp)) != 0 ||
683 CTR2(KTR_SIG, "sendsig: sigexit td=%p sfp=%p", td, sfp);
685 sigexit(td, SIGILL);
693 CTR3(KTR_SIG, "sendsig: return td=%p pc=%#lx sp=%#lx", td, tf->tf_tpc,
710 sys_sigreturn(struct thread *td, struct sigreturn_args *uap)
717 p = td->td_proc;
718 if (rwindow_save(td)) {
720 sigexit(td, SIGILL);
723 CTR2(KTR_SIG, "sigreturn: td=%p ucp=%p", td, uap->sigcntxp);
725 CTR1(KTR_SIG, "sigreturn: efault td=%p", td);
730 error = set_mcontext(td, mc);
734 kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0);
736 CTR4(KTR_SIG, "sigreturn: return td=%p pc=%#lx sp=%#lx tstate=%#lx",
737 td, mc->_mc_tpc, mc->_mc_sp, mc->_mc_tstate);
757 get_mcontext(struct thread *td, mcontext_t *mc, int flags)
762 tf = td->td_frame;
763 pcb = td->td_pcb;
812 set_mcontext(struct thread *td, mcontext_t *mc)
820 tf = td->td_frame;
821 pcb = td->td_pcb;
954 ptrace_set_pc(struct thread *td, u_long addr)
957 td->td_frame->tf_tpc = addr;
958 td->td_frame->tf_tnpc = addr + 4;
963 ptrace_single_step(struct thread *td)
971 ptrace_clear_single_step(struct thread *td)
979 exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
987 p = td->td_proc;
994 pcb = td->td_pcb;
995 tf = td->td_frame;
1010 td->td_retval[0] = tf->tf_out[0];
1011 td->td_retval[1] = tf->tf_out[1];
1015 fill_regs(struct thread *td, struct reg *regs)
1018 bcopy(td->td_frame, regs, sizeof(*regs));
1023 set_regs(struct thread *td, struct reg *regs)
1029 tf = td->td_frame;
1036 fill_dbregs(struct thread *td, struct dbreg *dbregs)
1043 set_dbregs(struct thread *td, struct dbreg *dbregs)
1050 fill_fpregs(struct thread *td, struct fpreg *fpregs)
1055 pcb = td->td_pcb;
1056 tf = td->td_frame;
1065 set_fpregs(struct thread *td, struct fpreg *fpregs)
1070 pcb = td->td_pcb;
1071 tf = td->td_frame;