Lines Matching refs:td

56 syscallenter(struct thread *td)
63 p = td->td_proc;
64 sa = &td->td_sa;
66 td->td_pticks = 0;
67 if (td->td_cowgen != p->p_cowgen)
68 thread_cow_update(td);
70 if (traced || td->td_dbgflags & TDB_USERWR) {
72 td->td_dbgflags &= ~TDB_USERWR;
74 td->td_dbgflags |= TDB_SCE;
77 error = (p->p_sysent->sv_fetch_syscall_args)(td);
79 if (KTRPOINT(td, KTR_SYSCALL))
83 (uintptr_t)td, "pid:%d", td->td_proc->p_pid, "arg0:%p", sa->args[0],
92 ptracestop((td), SIGTRAP, NULL);
95 if (td->td_dbgflags & TDB_USERWR) {
100 error = (p->p_sysent->sv_fetch_syscall_args)(td);
102 if (KTRPOINT(td, KTR_SYSCALL))
114 if (IN_CAPABILITY_MODE(td) &&
121 error = syscall_thread_enter(td, sa->callp);
131 AUDIT_SYSCALL_ENTER(sa->code, td);
132 error = (sa->callp->sy_call)(td, sa->args);
133 AUDIT_SYSCALL_EXIT(error, td);
136 if ((td->td_pflags & TDP_NERRNO) == 0)
137 td->td_errno = error;
143 error ? -1 : td->td_retval[0]);
145 syscall_thread_exit(td, sa->callp);
149 (uintptr_t)td, "pid:%d", td->td_proc->p_pid, "error:%d", error,
150 "retval0:%#lx", td->td_retval[0], "retval1:%#lx",
151 td->td_retval[1]);
154 td->td_dbgflags &= ~TDB_SCE;
157 (p->p_sysent->sv_set_syscall_retval)(td, error);
162 syscallret(struct thread *td, int error)
169 KASSERT((td->td_pflags & TDP_FORKING) == 0,
172 p = td->td_proc;
173 sa = &td->td_sa;
175 IN_CAPABILITY_MODE(td)) {
176 error1 = (td->td_pflags & TDP_NERRNO) == 0 ? error :
177 td->td_errno;
183 trapsignal(td, &ksi);
190 userret(td, td->td_frame);
193 if (KTRPOINT(td, KTR_SYSRET)) {
194 ktrsysret(sa->code, (td->td_pflags & TDP_NERRNO) == 0 ?
195 error : td->td_errno, td->td_retval[0]);
198 td->td_pflags &= ~TDP_NERRNO;
203 td->td_dbgflags |= TDB_SCX;
213 if (traced || (td->td_dbgflags & (TDB_EXEC | TDB_FORK)) != 0) {
222 ((td->td_dbgflags & (TDB_FORK | TDB_EXEC)) != 0 ||
224 ptracestop(td, SIGTRAP, NULL);
225 td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK);
229 if (td->td_pflags & TDP_RFPPWAIT) {
240 td->td_pflags &= ~TDP_RFPPWAIT;
241 p2 = td->td_rfppwait_p;
258 if (td->td_dbgflags & TDB_VFORK) {
261 ptracestop(td, SIGTRAP, NULL);
262 td->td_dbgflags &= ~TDB_VFORK;