Date: Fri, 16 Sep 2016 04:58:37 +0000 (UTC) From: Bruce Evans <bde@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305862 - in head/sys: amd64/amd64 i386/i386 Message-ID: <201609160458.u8G4wb8U042650@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bde Date: Fri Sep 16 04:58:37 2016 New Revision: 305862 URL: https://svnweb.freebsd.org/changeset/base/305862 Log: (1) Ifdef the new dr6 variable for KDB. While here, avoid using the old variable 'code' and remove it in trap(). ('code' was meant for holding things like %dr6, but is too small to hold %dr6 on amd64 and was reduced to an obfuscation of tf_err, with early truncation on amd64.) Submitted by: Michael Butler (imb@...) Modified: head/sys/amd64/amd64/trap.c head/sys/i386/i386/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Fri Sep 16 04:28:31 2016 (r305861) +++ head/sys/amd64/amd64/trap.c Fri Sep 16 04:58:37 2016 (r305862) @@ -176,8 +176,10 @@ trap(struct trapframe *frame) #endif struct thread *td = curthread; struct proc *p = td->td_proc; +#ifdef KDB register_t dr6; - int i = 0, ucode = 0, code; +#endif + int i = 0, ucode = 0; u_int type; register_t addr = 0; ksiginfo_t ksi; @@ -259,8 +261,6 @@ trap(struct trapframe *frame) } } - code = frame->tf_err; - if (TRAPF_USERMODE(frame)) { /* user trap */ @@ -378,7 +378,7 @@ trap(struct trapframe *frame) #ifdef DEV_ISA case T_NMI: /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) { + if (isa_nmi(frame->tf_err) == 0) { #ifdef KDB /* * NMI can be hooked up to a pushbutton @@ -564,7 +564,7 @@ trap(struct trapframe *frame) #ifdef DEV_ISA case T_NMI: /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) { + if (isa_nmi(frame->tf_err) == 0) { #ifdef KDB /* * NMI can be hooked up to a pushbutton Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Fri Sep 16 04:28:31 2016 (r305861) +++ head/sys/i386/i386/trap.c Fri Sep 16 04:58:37 2016 (r305862) @@ -189,8 +189,10 @@ trap(struct trapframe *frame) #endif struct thread *td = curthread; struct proc *p = td->td_proc; +#ifdef KDB register_t dr6; - int i = 0, ucode = 0, code; +#endif + int i = 0, ucode = 0; u_int type; register_t addr = 0; vm_offset_t eva; @@ -293,7 +295,6 @@ trap(struct trapframe *frame) } } eva = 0; - code = frame->tf_err; if (type == T_PAGEFLT) { /* * For some Cyrix CPUs, %cr2 is clobbered by @@ -467,7 +468,7 @@ user_trctrap_out: goto userout; #else /* !POWERFAIL_NMI */ /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) { + if (isa_nmi(frame->tf_err) == 0) { #ifdef KDB /* * NMI can be hooked up to a pushbutton @@ -730,7 +731,7 @@ kernel_trctrap: goto out; #else /* !POWERFAIL_NMI */ /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) { + if (isa_nmi(frame->tf_err) == 0) { #ifdef KDB /* * NMI can be hooked up to a pushbutton
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609160458.u8G4wb8U042650>