diff options
author | grehan <grehan@FreeBSD.org> | 2004-07-09 11:00:41 +0000 |
---|---|---|
committer | grehan <grehan@FreeBSD.org> | 2004-07-09 11:00:41 +0000 |
commit | 6c7bd732862424f5dc31c4f693756e0845eafcac (patch) | |
tree | 09de79876039b08645bed3c32152888114b080c1 /sys/powerpc/aim/trap.c | |
parent | 933877b6574b82689e571bd3cb41bf4af99caf2c (diff) | |
download | FreeBSD-src-6c7bd732862424f5dc31c4f693756e0845eafcac.zip FreeBSD-src-6c7bd732862424f5dc31c4f693756e0845eafcac.tar.gz |
- correctly set the return value for the copyin/out fault buffer to 1
so setfault would return correctly when a page fault was invalid
(e.g. a syscall with a bad parameter).
This caused an endless DSI loop, seen when running sendmail which
does a setlogin() call with a NULL pointer.
- introduce KTR_SYSC tracing. expose the syscallnames[] array to
make the tracing more readable.
Diffstat (limited to 'sys/powerpc/aim/trap.c')
-rw-r--r-- | sys/powerpc/aim/trap.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/powerpc/aim/trap.c b/sys/powerpc/aim/trap.c index 742003c..2738c57 100644 --- a/sys/powerpc/aim/trap.c +++ b/sys/powerpc/aim/trap.c @@ -97,9 +97,7 @@ int setfault(faultbuf); /* defined in locore.S */ int badaddr(void *, size_t); int badaddr_read(void *, size_t, int *); -#ifdef WITNESS extern char *syscallnames[]; -#endif struct powerpc_exception { u_int vector; @@ -321,6 +319,7 @@ handle_onfault(struct trapframe *frame) frame->srr0 = (*fb)[0]; frame->fixreg[1] = (*fb)[1]; frame->fixreg[2] = (*fb)[2]; + frame->fixreg[3] = 1; frame->cr = (*fb)[3]; bcopy(&(*fb)[4], &frame->fixreg[13], 19 * sizeof(register_t)); @@ -396,6 +395,12 @@ syscall(struct trapframe *frame) } else error = 0; + CTR5(KTR_SYSC, "syscall: p=%s %s(%x %x %x)", p->p_comm, + syscallnames[code], + frame->fixreg[FIRSTARG], + frame->fixreg[FIRSTARG+1], + frame->fixreg[FIRSTARG+2]); + #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) ktrsyscall(code, narg, (register_t *)params); @@ -413,6 +418,9 @@ syscall(struct trapframe *frame) STOPEVENT(p, S_SCE, narg); error = (*callp->sy_call)(td, params); + + CTR3(KTR_SYSC, "syscall: p=%s %s ret=%x", p->p_comm, + syscallnames[code], td->td_retval[0]); } switch (error) { case 0: |