diff --git a/sys/alpha/alpha/trap.c b/sys/alpha/alpha/trap.c index e91bc902f4c..634a0cd9e5b 100644 --- a/sys/alpha/alpha/trap.c +++ b/sys/alpha/alpha/trap.c @@ -662,7 +662,7 @@ syscall(code, framep) if (td->td_ucred != p->p_ucred) cred_update_thread(td); if (p->p_flag & P_SA) - thread_user_enter(p, td); + thread_user_enter(td); #ifdef DIAGNOSTIC alpha_fpstate_check(td); #endif diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index d9f8e819006..a3adaa43034 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -259,7 +259,7 @@ trap(frame) case T_PAGEFLT: /* page fault */ if (td->td_pflags & TDP_SA) - thread_user_enter(p, td); + thread_user_enter(td); i = trap_pfault(&frame, TRUE); if (i == -1) goto userout; @@ -695,7 +695,7 @@ syscall(frame) if (td->td_ucred != p->p_ucred) cred_update_thread(td); if (p->p_flag & P_SA) - thread_user_enter(p, td); + thread_user_enter(td); params = (caddr_t)frame.tf_rsp + sizeof(register_t); code = frame.tf_rax; orig_tf_rflags = frame.tf_rflags; diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index e066417a9ce..f1de1ad30e0 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -311,7 +311,7 @@ trap(frame) case T_PAGEFLT: /* page fault */ if (td->td_pflags & TDP_SA) - thread_user_enter(p, td); + thread_user_enter(td); i = trap_pfault(&frame, TRUE, eva); #if defined(I586_CPU) && !defined(NO_F00F_HACK) @@ -925,7 +925,7 @@ syscall(frame) if (td->td_ucred != p->p_ucred) cred_update_thread(td); if (p->p_flag & P_SA) - thread_user_enter(p, td); + thread_user_enter(td); params = (caddr_t)frame.tf_esp + sizeof(int); code = frame.tf_eax; orig_tf_eflags = frame.tf_eflags; diff --git a/sys/ia64/ia64/trap.c b/sys/ia64/ia64/trap.c index 373ffdb8b67..02a5b3d629c 100644 --- a/sys/ia64/ia64/trap.c +++ b/sys/ia64/ia64/trap.c @@ -983,7 +983,7 @@ syscall(struct trapframe *tf) if (td->td_ucred != p->p_ucred) cred_update_thread(td); if (p->p_flag & P_SA) - thread_user_enter(p, td); + thread_user_enter(td); if (p->p_sysent->sv_prepsyscall) { /* (*p->p_sysent->sv_prepsyscall)(tf, args, &code, ¶ms); */ diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c index 4b8a2c23bba..02ef46d64c7 100644 --- a/sys/kern/kern_kse.c +++ b/sys/kern/kern_kse.c @@ -1144,7 +1144,7 @@ thread_switchout(struct thread *td) * Setup done on the thread when it enters the kernel. */ void -thread_user_enter(struct proc *p, struct thread *td) +thread_user_enter(struct thread *td) { struct ksegrp *kg; struct kse_upcall *ku; @@ -1187,7 +1187,7 @@ thread_user_enter(struct proc *p, struct thread *td) } else { td->td_mailbox = tmbx; td->td_pflags |= TDP_CAN_UNBIND; - if (__predict_false(p->p_flag & P_TRACED)) { + if (__predict_false(td->td_proc->p_flag & P_TRACED)) { flags = fuword32(&tmbx->tm_dflags); if (flags & TMDF_SUSPEND) { mtx_lock_spin(&sched_lock); diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 4cd09ccf221..4ecbd03becd 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1487,7 +1487,7 @@ trapsignal(struct thread *td, int sig, u_long code) p = td->td_proc; if (td->td_pflags & TDP_SA) { if (td->td_mailbox == NULL) - thread_user_enter(p, td); + thread_user_enter(td); PROC_LOCK(p); SIGDELSET(td->td_sigmask, sig); mtx_lock_spin(&sched_lock); diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index ccdaa2db3fe..3f681039344 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -163,7 +163,7 @@ ast(struct trapframe *framep) td->td_frame = framep; if ((p->p_flag & P_SA) && (td->td_mailbox == NULL)) - thread_user_enter(p, td); + thread_user_enter(td); /* * This updates the p_sflag's for the checks below in one * "atomic" operation with turning off the astpending flag. diff --git a/sys/powerpc/aim/trap.c b/sys/powerpc/aim/trap.c index 52e2a698267..d6ed9ca6fd3 100644 --- a/sys/powerpc/aim/trap.c +++ b/sys/powerpc/aim/trap.c @@ -341,7 +341,7 @@ syscall(struct trapframe *frame) atomic_add_int(&cnt.v_syscall, 1); if (p->p_flag & P_SA) - thread_user_enter(p, td); + thread_user_enter(td); code = frame->fixreg[0]; params = (caddr_t)(frame->fixreg + FIRSTARG); diff --git a/sys/powerpc/powerpc/trap.c b/sys/powerpc/powerpc/trap.c index 52e2a698267..d6ed9ca6fd3 100644 --- a/sys/powerpc/powerpc/trap.c +++ b/sys/powerpc/powerpc/trap.c @@ -341,7 +341,7 @@ syscall(struct trapframe *frame) atomic_add_int(&cnt.v_syscall, 1); if (p->p_flag & P_SA) - thread_user_enter(p, td); + thread_user_enter(td); code = frame->fixreg[0]; params = (caddr_t)(frame->fixreg + FIRSTARG); diff --git a/sys/sparc64/sparc64/trap.c b/sys/sparc64/sparc64/trap.c index d5ec2c21791..06772ea2081 100644 --- a/sys/sparc64/sparc64/trap.c +++ b/sys/sparc64/sparc64/trap.c @@ -523,7 +523,7 @@ syscall(struct trapframe *tf) if (td->td_ucred != p->p_ucred) cred_update_thread(td); if (p->p_flag & P_SA) - thread_user_enter(p, td); + thread_user_enter(td); code = tf->tf_global[1]; /* diff --git a/sys/sys/proc.h b/sys/sys/proc.h index e3a09ca4d27..11a68a659dc 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -961,7 +961,7 @@ void thread_unsuspend(struct proc *p); void thread_unsuspend_one(struct thread *td); int thread_userret(struct thread *td, struct trapframe *frame); int thread_upcall_check(struct thread *td); -void thread_user_enter(struct proc *p, struct thread *td); +void thread_user_enter(struct thread *td); void thread_wait(struct proc *p); int thread_statclock(int user); struct kse_upcall *upcall_alloc(void);