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/amd64/ia32 | |
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/amd64/ia32')
-rw-r--r-- | sys/amd64/ia32/ia32_signal.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/amd64/ia32/ia32_signal.c b/sys/amd64/ia32/ia32_signal.c index a4293c8..8033443 100644 --- a/sys/amd64/ia32/ia32_signal.c +++ b/sys/amd64/ia32/ia32_signal.c @@ -565,7 +565,8 @@ freebsd4_freebsd32_sigreturn(td, uap) * one less debugger trap, so allowing it is fairly harmless. */ if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) { - printf("freebsd4_freebsd32_sigreturn: eflags = 0x%x\n", eflags); + uprintf("pid %d (%s): freebsd4_freebsd32_sigreturn eflags = 0x%x\n", + td->td_proc->p_pid, td->td_name, eflags); return (EINVAL); } @@ -576,7 +577,8 @@ freebsd4_freebsd32_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; @@ -647,7 +649,8 @@ freebsd32_sigreturn(td, uap) * one less debugger trap, so allowing it is fairly harmless. */ if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) { - printf("freebsd32_sigreturn: eflags = 0x%x\n", eflags); + uprintf("pid %d (%s): freebsd32_sigreturn eflags = 0x%x\n", + td->td_proc->p_pid, td->td_name, eflags); return (EINVAL); } @@ -658,7 +661,8 @@ freebsd32_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; |