diff options
author | kib <kib@FreeBSD.org> | 2010-04-13 10:12:58 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2010-04-13 10:12:58 +0000 |
commit | 24680f53887643c0e1c8e610518347a34d2515e6 (patch) | |
tree | ea49dc381f3858cdda45cd5ac713bf1bbcf42139 /sys/i386 | |
parent | 05b4eb119e3b18f969bbe18f5c2f0c47410c40df (diff) | |
download | FreeBSD-src-24680f53887643c0e1c8e610518347a34d2515e6.zip FreeBSD-src-24680f53887643c0e1c8e610518347a34d2515e6.tar.gz |
Change printf() calls to uprintf() for sigreturn() and trap() complaints
about inacessible or wrong mcontext, and for dreaded "kernel trap with
interrupts disabled" situation. The later is changed when trap is
generated from user mode (shall never be ?).
Normalize the messages to include both pid and thread name.
MFC after: 1 week
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/machdep.c | 12 | ||||
-rw-r--r-- | sys/i386/i386/trap.c | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 695b656..5293d53 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -944,7 +944,8 @@ freebsd4_sigreturn(td, uap) * one less debugger trap, so allowing it is fairly harmless. */ if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF)) { - printf("freebsd4_sigreturn: eflags = 0x%x\n", eflags); + uprintf("pid %d (%s): freebsd4_sigreturn eflags = 0x%x\n", + td->td_proc->p_pid, td->td_name, eflags); return (EINVAL); } @@ -955,7 +956,8 @@ freebsd4_sigreturn(td, uap) */ cs = ucp->uc_mcontext.mc_cs; if (!CS_SECURE(cs)) { - printf("freebsd4_sigreturn: cs = 0x%x\n", cs); + uprintf("pid %d (%s): freebsd4_sigreturn cs = 0x%x\n", + td->td_proc->p_pid, td->td_name, cs); ksiginfo_init_trap(&ksi); ksi.ksi_signo = SIGBUS; ksi.ksi_code = BUS_OBJERR; @@ -1056,7 +1058,8 @@ sigreturn(td, uap) * one less debugger trap, so allowing it is fairly harmless. */ if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF)) { - printf("sigreturn: eflags = 0x%x\n", eflags); + uprintf("pid %d (%s): sigreturn eflags = 0x%x\n", + td->td_proc->p_pid, td->td_name, eflags); return (EINVAL); } @@ -1067,7 +1070,8 @@ sigreturn(td, uap) */ cs = ucp->uc_mcontext.mc_cs; if (!CS_SECURE(cs)) { - printf("sigreturn: cs = 0x%x\n", cs); + uprintf("pid %d (%s): sigreturn cs = 0x%x\n", + td->td_proc->p_pid, td->td_name, cs); ksiginfo_init_trap(&ksi); ksi.ksi_signo = SIGBUS; ksi.ksi_code = BUS_OBJERR; diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index a2274e2..a11daa6 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -277,7 +277,7 @@ trap(struct trapframe *frame) * enabled later. */ if (ISPL(frame->tf_cs) == SEL_UPL || (frame->tf_eflags & PSL_VM)) - printf( + uprintf( "pid %ld (%s): trap %d with interrupts disabled\n", (long)curproc->p_pid, curthread->td_name, type); else if (type != T_BPTFLT && type != T_TRCTRAP && @@ -507,7 +507,7 @@ trap(struct trapframe *frame) if (npxdna()) goto userout; #endif - printf("pid %d killed due to lack of floating point\n", + uprintf("pid %d killed due to lack of floating point\n", p->p_pid); i = SIGKILL; ucode = 0; |