PERFORCE change 110622 for review
Oleksandr Tymoshenko
gonzo at FreeBSD.org
Tue Nov 28 07:35:55 PST 2006
http://perforce.freebsd.org/chv.cgi?CH=110622
Change 110622 by gonzo at gonzo_hq on 2006/11/28 15:34:57
o Brace my debug printfs with "#ifdef"s
o Give pc in message about userland memeory fault.
Affected files ...
.. //depot/projects/mips2/src/sys/mips/mips/trap.c#11 edit
Differences ...
==== //depot/projects/mips2/src/sys/mips/mips/trap.c#11 (text+ko) ====
@@ -184,9 +184,10 @@
break;
/* TODO: send signal */
- panic("Send signal to userland here... error=%d, va=0x%08x\n",
- error, va);
+ printf("Userland memory access error %d on va=%08x, pc=%08x\n",
+ error, va, tf->tf_regs[TF_EPC] );
+ panic("TODO: signal on memory access errors");
case TrSys:
syscall(curthread, tf);
goto done;
@@ -334,10 +335,13 @@
callp = &p->p_sysent->sv_table[code];
nargs = callp->sy_narg & SYF_ARGMASK;
+ /* syscallnames is available only of INVARIANTS are on */
+#ifdef INVARIANTS
printf("syscall enter thread %p pid %d proc " \
"%s code %d(%s) nargs: %d\n", td,
td->td_proc->p_pid, td->td_proc->p_comm, code,
syscallnames[code], nargs);
+#endif
/* Copy arguments from a0..a4 */
for(i = 0; i < MIN(nargs, 4 - args_shift); i++)
@@ -425,6 +429,14 @@
frame->tf_regs[TF_EPC] += 4;
userret(td, frame);
+ /* syscallnames is available only of INVARIANTS are on */
+#ifdef INVARIANTS
+ printf("syscall exit thread %p pid %d proc " \
+ "%s code %d(%s) nargs: %d error=%d\n", td,
+ td->td_proc->p_pid, td->td_proc->p_comm, code,
+ syscallnames[code], nargs, error);
+#endif
+
CTR4(KTR_SYSC, "syscall exit thread %p pid %d proc %s code %d", td,
td->td_proc->p_pid, td->td_proc->p_comm, code);
More information about the p4-projects
mailing list