qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Tom Musta <tommusta@gmail.com>
To: qemu-devel@nongnu.org
Cc: Tom Musta <tommusta@gmail.com>, qemu-ppc@nongnu.org
Subject: [Qemu-devel] [V3 PATCH 1/2] target-ppc: Fix target_disas
Date: Tue,  8 Apr 2014 14:26:13 -0500	[thread overview]
Message-ID: <1396985174-13212-2-git-send-email-tommusta@gmail.com> (raw)
In-Reply-To: <1396985174-13212-1-git-send-email-tommusta@gmail.com>

Inspect only bit 16 for the Little Endian test.  Correct comment preceding
the target_disas() function.

Signed-off-by: Tom Musta <tommusta@gmail.com>
---

V2: new

 disas.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/disas.c b/disas.c
index 79e6944..a427d18 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,7 +252,7 @@ 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) {
-- 
1.7.1

  reply	other threads:[~2014-04-08 19:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08 19:26 [Qemu-devel] [V3 PATCH 0/2] QEMU Monitor Instruction Disassembly Incorrect for PPC LE Tom Musta
2014-04-08 19:26 ` Tom Musta [this message]
2014-04-09  7:31   ` [Qemu-devel] [V3 PATCH 1/2] target-ppc: Fix target_disas Peter Maydell
2014-04-08 19:26 ` [Qemu-devel] [V3 PATCH 2/2] monitor: QEMU Monitor Instruction Disassembly Incorrect for PowerPC LE Mode Tom Musta
2014-04-09  7:34   ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1396985174-13212-2-git-send-email-tommusta@gmail.com \
    --to=tommusta@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).