diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-08-25 22:30:56 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-08-25 22:30:56 +0000 |
commit | 7c08dbf325fc301e4889fd352222d94d9d6b0451 (patch) | |
tree | d8454748bd753059f56314e27188b7d75746aca1 /ppc-dis.c | |
parent | 9bf05444b24f10616b9e9b9f296bcfdcba4ff0df (diff) | |
download | qemu-7c08dbf325fc301e4889fd352222d94d9d6b0451.zip qemu-7c08dbf325fc301e4889fd352222d94d9d6b0451.tar.gz qemu-7c08dbf325fc301e4889fd352222d94d9d6b0451.tar.bz2 |
endianness fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1055 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'ppc-dis.c')
-rw-r--r-- | ppc-dis.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -3076,15 +3076,20 @@ static int print_insn_powerpc(FILE *, uint32_t insn, unsigned memaddr, int diale int print_insn_ppc (bfd_vma pc, disassemble_info *info) { uint32_t opc; - - (*info->read_memory_func)(pc, (bfd_byte *)(&opc), 4, info); - return print_insn_powerpc (info->stream, tswap32(opc), pc, + bfd_byte buf[4]; + + (*info->read_memory_func)(pc, buf, 4, info); + if (info->endian == BFD_ENDIAN_BIG) + opc = bfd_getb32(buf); + else + opc = bfd_getl32(buf); + return print_insn_powerpc (info->stream, opc, pc, PPC | B32 | M601); } /* Print a PowerPC or POWER instruction. */ -int +static int print_insn_powerpc (FILE *out, uint32_t insn, unsigned memaddr, int dialect) { |