From owner-svn-src-head@freebsd.org Fri Dec 16 04:47:30 2016 Return-Path: Delivered-To: svn-src-head@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 5B8C1C76CDC; Fri, 16 Dec 2016 04:47:30 +0000 (UTC) (envelope-from jhibbits@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 245EF1AFF; Fri, 16 Dec 2016 04:47:30 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBG4lT33090894; Fri, 16 Dec 2016 04:47:29 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG4lTir090893; Fri, 16 Dec 2016 04:47:29 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201612160447.uBG4lTir090893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 16 Dec 2016 04:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310150 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2016 04:47:30 -0000 Author: jhibbits Date: Fri Dec 16 04:47:29 2016 New Revision: 310150 URL: https://svnweb.freebsd.org/changeset/base/310150 Log: Fix disassembly by adding back some deleted lines. When importing for r309309, as part of conflict resolution, too much extra was removed, resulting in bad disassembly for branches. Correct this. Also re-apply the 0->NULL change from r298052. X-MFC-With: r309309 Modified: head/sys/powerpc/powerpc/db_disasm.c Modified: head/sys/powerpc/powerpc/db_disasm.c ============================================================================== --- head/sys/powerpc/powerpc/db_disasm.c Fri Dec 16 04:44:46 2016 (r310149) +++ head/sys/powerpc/powerpc/db_disasm.c Fri Dec 16 04:47:29 2016 (r310150) @@ -871,8 +871,11 @@ disasm_fields(const struct opcode *popco func &= ~Op_crbB; } if (func & Op_LI) { - u_int LI; + int LI; LI = extract_field(instr, 31 - 29, 24); + LI = LI << 8; + LI = LI >> 6; + LI += loc; APP_PSTR("0x%x", LI); func &= ~Op_LI; } @@ -897,8 +900,11 @@ disasm_fields(const struct opcode *popco ; } if (func & Op_BD) { - u_int BD; + int BD; BD = extract_field(instr, 31 - 29, 14); + BD = BD << 18; + BD = BD >> 16; + BD += loc; /* Need to sign extend and shift up 2, then add addr */ APP_PSTR("0x%x", BD); func &= ~Op_BD; @@ -968,9 +974,9 @@ disasm_fields(const struct opcode *popco reg = "tbu"; break; default: - reg = 0; + reg = NULL; } - if (reg == 0) + if (reg == NULL) APP_PSTR(", [unknown tbr %d ]", tbr); else APP_PSTR(", %s", reg);