/freebsd/sys/kern/ |
H A D | sys_process.c | 830 struct thread *td2; in ptrace_sel_coredump_thread() local 835 FOREACH_THREAD_IN_PROC(p, td2) { in ptrace_sel_coredump_thread() 836 if ((td2->td_dbgflags & TDB_SSWITCH) != 0) in ptrace_sel_coredump_thread() 837 return (td2); in ptrace_sel_coredump_thread() 848 struct thread *td2 = NULL, *td3; in kern_ptrace() local 901 td2 = tdfind(pid, -1); in kern_ptrace() 902 if (td2 == NULL) { in kern_ptrace() 907 p = td2->td_proc; in kern_ptrace() 935 td2 = p->p_xthread; in kern_ptrace() 937 td2 = FIRST_THREAD_IN_PROC(p); in kern_ptrace() [all …]
|
H A D | kern_thread.c | 934 struct thread *td2; in thread_exit() local 970 td2 = FIRST_THREAD_IN_PROC(p); in thread_exit() 971 sched_exit_thread(td2, td); in thread_exit() 1136 weed_inhib(int mode, struct thread *td2, struct proc *p) in weed_inhib() argument 1140 THREAD_LOCK_ASSERT(td2, MA_OWNED); in weed_inhib() 1149 if (TD_IS_SUSPENDED(td2)) { in weed_inhib() 1150 thread_unsuspend_one(td2, p, true); in weed_inhib() 1151 thread_lock(td2); in weed_inhib() 1154 if (TD_CAN_ABORT(td2)) { in weed_inhib() 1155 sleepq_abort(td2, EINTR); in weed_inhib() [all …]
|
H A D | kern_fork.c | 366 do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread *td2, in do_fork() argument 404 tidhash_add(td2); in do_fork() 461 bzero(&td2->td_startzero, in do_fork() 464 bcopy(&td->td_startcopy, &td2->td_startcopy, in do_fork() 467 bcopy(&p2->p_comm, &td2->td_name, sizeof(td2->td_name)); in do_fork() 468 td2->td_sigstk = td->td_sigstk; in do_fork() 469 td2->td_flags = TDF_INMEM; in do_fork() 470 td2->td_lend_user_pri = PRI_MAX; in do_fork() 473 td2->td_vnet = NULL; in do_fork() 474 td2->td_vnet_lpush = NULL; in do_fork() [all …]
|
H A D | tty_info.c | 109 thread_compare(struct thread *td, struct thread *td2) in thread_compare() argument 126 thread_lock(td2); in thread_compare() 127 runb = TD_IS_RUNNING(td2) || TD_ON_RUNQ(td2); in thread_compare() 128 estb = sched_pctcpu(td2); in thread_compare() 129 slpb = td2->td_flags & TDF_SINTR; in thread_compare() 130 thread_unlock(td2); in thread_compare() 161 return (td < td2); in thread_compare()
|
H A D | kern_switch.c | 441 struct thread *td2; in runq_choose_fuzz() local 442 td2 = td = TAILQ_FIRST(rqh); in runq_choose_fuzz() 444 while (count-- && td2) { in runq_choose_fuzz() 445 if (td2->td_lastcpu == cpu) { in runq_choose_fuzz() 446 td = td2; in runq_choose_fuzz() 449 td2 = TAILQ_NEXT(td2, td_runq); in runq_choose_fuzz()
|
H A D | kern_sig.c | 2029 struct thread *td2; in kern_sigqueue() local 2047 td2 = NULL; in kern_sigqueue() 2050 td2 = tdfind((lwpid_t)pid, p->p_pid); in kern_sigqueue() 2051 if (td2 == NULL) in kern_sigqueue() 2064 error = tdsendsignal(p, td2, ksi.ksi_signo, &ksi); in kern_sigqueue() 2781 struct thread *td2; in sig_suspend_threads() local 2786 FOREACH_THREAD_IN_PROC(p, td2) { in sig_suspend_threads() 2787 thread_lock(td2); in sig_suspend_threads() 2788 ast_sched_locked(td2, TDA_SUSPEND); in sig_suspend_threads() 2789 if (TD_IS_SLEEPING(td2) && (td2->td_flags & TDF_SINTR) != 0) { in sig_suspend_threads() [all …]
|
H A D | subr_turnstile.c | 315 struct thread *td1, *td2; in turnstile_adjust_thread() local 341 td2 = TAILQ_NEXT(td, td_lockq); in turnstile_adjust_thread() 343 (td2 != NULL && td->td_priority > td2->td_priority)) { in turnstile_adjust_thread()
|
H A D | kern_ktrace.c | 656 struct thread *td2; in ktrprocctor_entered() local 659 td2 = FIRST_THREAD_IN_PROC(p); in ktrprocctor_entered() 660 req = ktr_getrequest_entered(td2, KTR_PROCCTOR); in ktrprocctor_entered() 665 ktr_enqueuerequest(td2, req); in ktrprocctor_entered()
|
H A D | kern_time.c | 293 struct thread *td2; in get_cputime() 301 td2 = tdfind(tid, p->p_pid); in get_cputime() 302 if (td2 == NULL) in get_cputime() 304 kern_thread_cputime(td2, ats); in get_cputime() 305 PROC_UNLOCK(td2->td_proc); in get_cputime() 292 struct thread *td2; get_cputime() local
|
/freebsd/sys/arm64/arm64/ |
H A D | vm_machdep.c | 70 cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) in cpu_fork() argument 92 pcb2 = (struct pcb *)(td2->td_kstack + in cpu_fork() 93 td2->td_kstack_pages * PAGE_SIZE) - 1; in cpu_fork() 95 td2->td_pcb = pcb2; in cpu_fork() 101 ptrauth_fork(td2, td1); in cpu_fork() 109 td2->td_frame = tf; in cpu_fork() 112 td2->td_pcb->pcb_x[PCB_X19] = (uintptr_t)fork_return; in cpu_fork() 113 td2->td_pcb->pcb_x[PCB_X20] = (uintptr_t)td2; in cpu_fork() 114 td2->td_pcb->pcb_x[PCB_LR] = (uintptr_t)fork_trampoline; in cpu_fork() 115 td2->td_pcb->pcb_sp = (uintptr_t)td2->td_frame; in cpu_fork() [all …]
|
/freebsd/sys/riscv/riscv/ |
H A D | vm_machdep.c | 86 cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) in cpu_fork() argument 96 cpu_set_pcb_frame(td2); in cpu_fork() 98 pcb2 = td2->td_pcb; in cpu_fork() 101 tf = td2->td_frame; in cpu_fork() 114 td2->td_pcb->pcb_s[0] = (uintptr_t)fork_return; in cpu_fork() 115 td2->td_pcb->pcb_s[1] = (uintptr_t)td2; in cpu_fork() 116 td2->td_pcb->pcb_ra = (uintptr_t)fork_trampoline; in cpu_fork() 117 td2->td_pcb->pcb_sp = (uintptr_t)td2->td_frame; in cpu_fork() 120 td2->td_md.md_spinlock_count = 1; in cpu_fork() 121 td2->td_md.md_saved_sstatus_ie = (SSTATUS_SIE); in cpu_fork()
|
/freebsd/sys/arm/arm/ |
H A D | vm_machdep.c | 91 cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) in cpu_fork() argument 102 (td2->td_kstack + td2->td_kstack_pages * PAGE_SIZE) - 1; in cpu_fork() 110 td2->td_pcb = pcb2; in cpu_fork() 120 td2->td_frame = (struct trapframe *)pcb2 - 1; in cpu_fork() 121 *td2->td_frame = *td1->td_frame; in cpu_fork() 130 pcb2->pcb_regs.sf_r5 = (register_t)td2; in cpu_fork() 132 pcb2->pcb_regs.sf_sp = STACKALIGN(td2->td_frame); in cpu_fork() 136 vfp_new_thread(td2, td1, true); in cpu_fork() 139 tf = td2->td_frame; in cpu_fork() 145 td2->td_md.md_spinlock_count = 1; in cpu_fork() [all …]
|
/freebsd/sys/i386/i386/ |
H A D | vm_machdep.c | 138 copy_thread(struct thread *td1, struct thread *td2) in copy_thread() argument 142 pcb2 = td2->td_pcb; in copy_thread() 145 if ((td2->td_pflags & TDP_KTHREAD) == 0) { in copy_thread() 161 if ((td2->td_pflags & TDP_KTHREAD) != 0) { in copy_thread() 163 set_fsbase(td2, 0); in copy_thread() 164 set_gsbase(td2, 0); in copy_thread() 180 pcb2->pcb_esp = (int)td2->td_frame - sizeof(void *); /* trampoline arg */ in copy_thread() 181 pcb2->pcb_ebx = (int)td2; /* trampoline arg */ in copy_thread() 196 td2->td_md.md_spinlock_count = 1; in copy_thread() 197 td2->td_md.md_saved_flags = PSL_KERNEL | PSL_I; in copy_thread() [all …]
|
/freebsd/sys/compat/linux/ |
H A D | linux_fork.c | 70 struct thread *td2; in linux_fork() local 78 td2 = FIRST_THREAD_IN_PROC(p2); in linux_fork() 80 linux_proc_init(td, td2, false); in linux_fork() 87 thread_lock(td2); in linux_fork() 88 TD_SET_CAN_RUN(td2); in linux_fork() 89 sched_add(td2, SRQ_BORING); in linux_fork() 100 struct thread *td2; in linux_vfork() local 108 td2 = FIRST_THREAD_IN_PROC(p2); in linux_vfork() 110 linux_proc_init(td, td2, false); in linux_vfork() 117 thread_lock(td2); in linux_vfork() [all …]
|
H A D | linux_futex.c | 898 struct thread *td2; in linux_get_robust_list() local 906 td2 = linux_tdfind(td, args->pid, -1); in linux_get_robust_list() 907 if (td2 == NULL) in linux_get_robust_list() 909 if (SV_PROC_ABI(td2->td_proc) != SV_ABI_LINUX) { in linux_get_robust_list() 910 PROC_UNLOCK(td2->td_proc); in linux_get_robust_list() 914 em = em_find(td2); in linux_get_robust_list() 919 p_candebug(td, td2->td_proc)) { in linux_get_robust_list() 920 PROC_UNLOCK(td2->td_proc); in linux_get_robust_list() 925 PROC_UNLOCK(td2->td_proc); in linux_get_robust_list()
|
/freebsd/sys/amd64/amd64/ |
H A D | vm_machdep.c | 138 copy_thread(struct thread *td1, struct thread *td2) in copy_thread() argument 142 pcb2 = td2->td_pcb; in copy_thread() 145 if ((td2->td_pflags & TDP_KTHREAD) == 0) { in copy_thread() 158 if ((td2->td_pflags & TDP_KTHREAD) != 0) { in copy_thread() 169 td2->td_frame = (struct trapframe *)td2->td_md.md_stack_base - 1; in copy_thread() 177 pcb2->pcb_rsp = (register_t)td2->td_frame - sizeof(void *); in copy_thread() 178 pcb2->pcb_rbx = (register_t)td2; /* fork_trampoline argument */ in copy_thread() 191 td2->td_md.md_spinlock_count = 1; in copy_thread() 192 td2->td_md.md_saved_flags = PSL_KERNEL | PSL_I; in copy_thread() 193 pmap_thread_init_invl_gen(td2); in copy_thread() [all …]
|
/freebsd/sys/powerpc/powerpc/ |
H A D | vm_machdep.c | 108 cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) in cpu_fork() argument 126 pcb = (struct pcb *)((td2->td_kstack + in cpu_fork() 127 td2->td_kstack_pages * PAGE_SIZE - sizeof(struct pcb)) & ~0x2fUL); in cpu_fork() 128 td2->td_pcb = pcb; in cpu_fork() 146 td2->td_frame = tf; in cpu_fork() 154 cf->cf_arg0 = (register_t)td2; in cpu_fork() 171 td2->td_md.md_spinlock_count = 1; in cpu_fork() 172 td2->td_md.md_saved_msr = psl_kernset; in cpu_fork()
|
/freebsd/cddl/contrib/opensolaris/tools/ctf/cvt/ |
H A D | tdata.c | 460 tdata_merge(tdata_t *td1, tdata_t *td2) in tdata_merge() argument 462 td1->td_curemark = MAX(td1->td_curemark, td2->td_curemark); in tdata_merge() 463 td1->td_curvgen = MAX(td1->td_curvgen, td2->td_curvgen); in tdata_merge() 464 td1->td_nextid = MAX(td1->td_nextid, td2->td_nextid); in tdata_merge() 466 hash_merge(td1->td_iihash, td2->td_iihash); in tdata_merge() 469 tdata_build_hashes_common(td1, td2->td_iihash); in tdata_merge() 471 list_concat(&td1->td_fwdlist, td2->td_fwdlist); in tdata_merge() 472 td2->td_fwdlist = NULL; in tdata_merge() 474 slist_merge(&td1->td_labels, td2->td_labels, in tdata_merge() 476 td2->td_labels = NULL; in tdata_merge() [all …]
|
/freebsd/sys/fs/procfs/ |
H A D | procfs_dbregs.c | 86 struct thread *td2; in procfs_doprocdbregs() local 102 td2 = FIRST_THREAD_IN_PROC(p); in procfs_doprocdbregs() 105 if (SV_PROC_FLAG(td2->td_proc, SV_ILP32) == 0) { in procfs_doprocdbregs() 114 error = PROC(read, dbregs, td2, &r); in procfs_doprocdbregs() 125 error = PROC(write, dbregs, td2, &r); in procfs_doprocdbregs()
|
H A D | procfs_fpregs.c | 80 struct thread *td2; in procfs_doprocfpregs() local 100 td2 = FIRST_THREAD_IN_PROC(p); in procfs_doprocfpregs() 103 if (SV_PROC_FLAG(td2->td_proc, SV_ILP32) == 0) { in procfs_doprocfpregs() 112 error = PROC(read, fpregs, td2, &r); in procfs_doprocfpregs() 123 error = PROC(write, fpregs, td2, &r); in procfs_doprocfpregs()
|
H A D | procfs_regs.c | 80 struct thread *td2; in procfs_doprocregs() local 100 td2 = FIRST_THREAD_IN_PROC(p); in procfs_doprocregs() 103 if ((SV_PROC_FLAG(td2->td_proc, SV_ILP32)) == 0) { in procfs_doprocregs() 112 error = PROC(read, regs, td2, &r); in procfs_doprocregs() 123 error = PROC(write, regs, td2, &r); in procfs_doprocregs()
|
/freebsd/lib/libc/tests/nss/ |
H A D | testutil.h | 62 #define TEST_DATA_COMPARE(ent, td1, td2, fcmp, mdata)\ argument 63 __##ent##_test_data_compare(td1, td2, fcmp, mdata); 127 __##ent##_test_data_compare(struct ent##_test_data *td1, struct ent##_test_data *td2,\ 134 ATF_REQUIRE(td2 != NULL); \ 138 e2 = STAILQ_FIRST(&td2->snapshot_data); \ 314 #define DO_2PASS_TEST(ent, td1, td2, f, mdata) \ argument 315 __##ent##_2pass_test(td1, td2, f, mdata) 320 struct ent##_test_data *td2, \ 326 rv = __##ent##_test_data_compare(td1, td2, cmp_func, cmp_mdata);\
|
/freebsd/sys/i386/linux/ |
H A D | linux_ptrace_machdep.c | 329 struct thread *td2; in linux_ptrace() local 381 td2 = FIRST_THREAD_IN_PROC(p); in linux_ptrace() 382 error = linux_proc_read_fpxregs(td2, &r.fpxreg); in linux_ptrace() 392 td2 = FIRST_THREAD_IN_PROC(p); in linux_ptrace() 393 error = linux_proc_write_fpxregs(td2, &r.fpxreg); in linux_ptrace()
|
/freebsd/sys/vm/ |
H A D | vm_glue.c | 784 vm_forkproc(struct thread *td, struct proc *p2, struct thread *td2, in vm_forkproc() argument 802 cpu_fork(td, p2, td2, flags); in vm_forkproc() 810 dset = td2->td_domain.dr_policy; in vm_forkproc() 825 cpu_fork(td, p2, td2, flags); in vm_forkproc()
|
/freebsd/sys/compat/linprocfs/ |
H A D | linprocfs.c | 1073 struct thread *td2; in linprocfs_doprocstatus() local 1080 td2 = FIRST_THREAD_IN_PROC(p); in linprocfs_doprocstatus() 1094 switch(TD_GET_STATE(td2)) { in linprocfs_doprocstatus()
|