From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXyZ2-0006pD-FM for qemu-devel@nongnu.org; Wed, 09 Apr 2014 15:53:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXyYx-0006iW-0P for qemu-devel@nongnu.org; Wed, 09 Apr 2014 15:53:40 -0400 From: Tom Musta Date: Wed, 9 Apr 2014 14:53:23 -0500 Message-Id: <1397073204-14712-2-git-send-email-tommusta@gmail.com> In-Reply-To: <1397073204-14712-1-git-send-email-tommusta@gmail.com> References: <1397073204-14712-1-git-send-email-tommusta@gmail.com> Subject: [Qemu-devel] [PATCH 1/2] target-ppc: Fix target_disas List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Tom Musta , qemu-ppc@nongnu.org Inspect only bit 16 for the Little Endian test. Correct comment preceding the target_disas() function. Correct grammar in comment for flags processing. Signed-off-by: Tom Musta Reviewed-by: Peter Maydell --- V4: Correct grammar "definitions of the instructions set" ==> "definition of the instruction set" disas.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/disas.c b/disas.c index 79e6944..1397167 100644 --- a/disas.c +++ b/disas.c @@ -191,7 +191,8 @@ static int print_insn_od_target(bfd_vma pc, disassemble_info *info) values: i386 - 1 means 16 bit code, 2 means 64 bit code arm - bit 0 = thumb, bit 1 = reverse endian, bit 2 = A64 - ppc - nonzero means little endian + ppc - bits 0:15 specify (optionally) the machine instruction set; + bit 16 indicates little endian. other targets - unused */ void target_disas(FILE *out, CPUArchState *env, target_ulong code, @@ -251,11 +252,11 @@ void target_disas(FILE *out, CPUArchState *env, target_ulong code, s.info.mach = bfd_mach_sparc_v9b; #endif #elif defined(TARGET_PPC) - if (flags >> 16) { + if ((flags >> 16) & 1) { s.info.endian = BFD_ENDIAN_LITTLE; } if (flags & 0xFFFF) { - /* If we have a precise definitions of the instructions set, use it */ + /* If we have a precise definition of the instruction set, use it. */ s.info.mach = flags & 0xFFFF; } else { #ifdef TARGET_PPC64 -- 1.7.1