diff options
Diffstat (limited to 'sys/kern/subr_syscall.c')
-rw-r--r-- | sys/kern/subr_syscall.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c index 2bcad34..0182884 100644 --- a/sys/kern/subr_syscall.c +++ b/sys/kern/subr_syscall.c @@ -52,13 +52,15 @@ __FBSDID("$FreeBSD$"); #include <security/audit/audit.h> static inline int -syscallenter(struct thread *td, struct syscall_args *sa) +syscallenter(struct thread *td) { struct proc *p; + struct syscall_args *sa; int error, traced; PCPU_INC(cnt.v_syscall); p = td->td_proc; + sa = &td->td_sa; td->td_pticks = 0; if (td->td_cowgen != p->p_cowgen) @@ -71,7 +73,7 @@ syscallenter(struct thread *td, struct syscall_args *sa) td->td_dbgflags |= TDB_SCE; PROC_UNLOCK(p); } - error = (p->p_sysent->sv_fetch_syscall_args)(td, sa); + error = (p->p_sysent->sv_fetch_syscall_args)(td); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) ktrsyscall(sa->code, sa->narg, sa->args); @@ -85,8 +87,6 @@ syscallenter(struct thread *td, struct syscall_args *sa) STOPEVENT(p, S_SCE, sa->narg); if (p->p_flag & P_TRACED) { PROC_LOCK(p); - td->td_dbg_sc_code = sa->code; - td->td_dbg_sc_narg = sa->narg; if (p->p_ptevents & PTRACE_SCE) ptracestop((td), SIGTRAP, NULL); PROC_UNLOCK(p); @@ -96,11 +96,7 @@ syscallenter(struct thread *td, struct syscall_args *sa) * Reread syscall number and arguments if * debugger modified registers or memory. */ - error = (p->p_sysent->sv_fetch_syscall_args)(td, sa); - PROC_LOCK(p); - td->td_dbg_sc_code = sa->code; - td->td_dbg_sc_narg = sa->narg; - PROC_UNLOCK(p); + error = (p->p_sysent->sv_fetch_syscall_args)(td); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) ktrsyscall(sa->code, sa->narg, sa->args); @@ -162,9 +158,10 @@ syscallenter(struct thread *td, struct syscall_args *sa) } static inline void -syscallret(struct thread *td, int error, struct syscall_args *sa) +syscallret(struct thread *td, int error) { struct proc *p, *p2; + struct syscall_args *sa; ksiginfo_t ksi; int traced, error1; @@ -172,6 +169,7 @@ syscallret(struct thread *td, int error, struct syscall_args *sa) ("fork() did not clear TDP_FORKING upon completion")); p = td->td_proc; + sa = &td->td_sa; if ((trap_enotcap || (p->p_flag2 & P2_TRAPCAP) != 0) && IN_CAPABILITY_MODE(td)) { error1 = (td->td_pflags & TDP_NERRNO) == 0 ? error : |