SCCS-vsn: sys/tahoe/tahoe/trap.c 7.6
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
- * @(#)trap.c 7.5 (Berkeley) %G%
+ * @(#)trap.c 7.6 (Berkeley) %G%
-#ifdef SYSCALLTRACE
-int syscalltrace = 0;
-#endif
-
/*
* Called from locore when a system call occurs
*/
/*
* Called from locore when a system call occurs
*/
(u.u_error = copyin(params, (caddr_t)u.u_arg, (u_int)i)) != 0) {
locr0[R0] = u.u_error;
locr0[PS] |= PSL_C; /* carry bit */
(u.u_error = copyin(params, (caddr_t)u.u_arg, (u_int)i)) != 0) {
locr0[R0] = u.u_error;
locr0[PS] |= PSL_C; /* carry bit */
+#ifdef KTRACE
+ if (KTRPOINT(p, KTR_SYSCALL))
+ ktrsyscall(p->p_tracep, code, callp->sy_narg);
+#endif
+#ifdef KTRACE
+ if (KTRPOINT(p, KTR_SYSCALL))
+ ktrsyscall(p->p_tracep, code, callp->sy_narg);
+#endif
u.u_r.r_val1 = 0;
u.u_r.r_val2 = locr0[R1];
if (setjmp(&u.u_qsave)) {
u.u_r.r_val1 = 0;
u.u_r.r_val2 = locr0[R1];
if (setjmp(&u.u_qsave)) {
u.u_error = EINTR;
} else {
u.u_eosys = NORMALRETURN;
u.u_error = EINTR;
} else {
u.u_eosys = NORMALRETURN;
-#ifdef KTRACE
- if (KTRPOINT(p, KTR_SYSCALL))
- ktrsyscall(p->p_tracep, code, callp->sy_narg);
-#endif
(*callp->sy_call)(&u);
}
if (u.u_eosys == NORMALRETURN) {
(*callp->sy_call)(&u);
}
if (u.u_eosys == NORMALRETURN) {
pc = opc;
/* else if (u.u_eosys == JUSTRETURN) */
/* nothing to do */
pc = opc;
/* else if (u.u_eosys == JUSTRETURN) */
/* nothing to do */
-#ifdef KTRACE
- if (KTRPOINT(p, KTR_SYSRET))
- ktrsysret(p->p_tracep, code);
-#endif
+ /*
+ * Reinitialize proc pointer `p' as it may be different
+ * if this is a child returning from fork syscall.
+ */
p = u.u_procp;
if (p->p_cursig || ISSIG(p))
psig();
p = u.u_procp;
if (p->p_cursig || ISSIG(p))
psig();
addupc(locr0[PC], &u.u_prof, ticks);
}
curpri = p->p_pri;
addupc(locr0[PC], &u.u_prof, ticks);
}
curpri = p->p_pri;
+#ifdef KTRACE
+ if (KTRPOINT(p, KTR_SYSRET))
+ ktrsysret(p->p_tracep, code);
+#endif