From owner-svn-src-all@freebsd.org Fri Sep 16 04:58:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AA70BDC0A8; Fri, 16 Sep 2016 04:58:39 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2D3D8D0; Fri, 16 Sep 2016 04:58:38 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G4wcRg042652; Fri, 16 Sep 2016 04:58:38 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G4wb8U042650; Fri, 16 Sep 2016 04:58:37 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609160458.u8G4wb8U042650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 16 Sep 2016 04:58:37 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 04:58:39 -0000 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