summaryrefslogtreecommitdiff
path: root/disas.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-07-02 14:58:51 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-07-02 14:58:51 +0000
commit6af0bf9c7c3ab9ddbf74a3bf34e067761eb43c3d (patch)
tree81d0ac2bbc2f0fdacfff7619c36ded224775c45f /disas.c
parent6643d27ea00f3580fb0120219bd510f00b64bca5 (diff)
downloadqemu-6af0bf9c7c3ab9ddbf74a3bf34e067761eb43c3d.tar.gz
qemu-6af0bf9c7c3ab9ddbf74a3bf34e067761eb43c3d.tar.bz2
qemu-6af0bf9c7c3ab9ddbf74a3bf34e067761eb43c3d.zip
MIPS target (Jocelyn Mayer)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1464 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'disas.c')
-rw-r--r--disas.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/disas.c b/disas.c
index c54e5d91c0..f713040daa 100644
--- a/disas.c
+++ b/disas.c
@@ -108,6 +108,24 @@ bfd_vma bfd_getb32 (const bfd_byte *addr)
return (bfd_vma) v;
}
+bfd_vma bfd_getl16 (const bfd_byte *addr)
+{
+ unsigned long v;
+
+ v = (unsigned long) addr[0];
+ v |= (unsigned long) addr[1] << 8;
+ return (bfd_vma) v;
+}
+
+bfd_vma bfd_getb16 (const bfd_byte *addr)
+{
+ unsigned long v;
+
+ v = (unsigned long) addr[0] << 24;
+ v |= (unsigned long) addr[1] << 16;
+ return (bfd_vma) v;
+}
+
#ifdef TARGET_ARM
static int
print_insn_thumb1(bfd_vma pc, disassemble_info *info)
@@ -162,6 +180,8 @@ void target_disas(FILE *out, target_ulong code, target_ulong size, int flags)
if (cpu_single_env->msr[MSR_LE])
disasm_info.endian = BFD_ENDIAN_LITTLE;
print_insn = print_insn_ppc;
+#elif defined(TARGET_MIPS)
+ print_insn = print_insn_big_mips;
#else
fprintf(out, "0x" TARGET_FMT_lx
": Asm output not supported on this arch\n", code);
@@ -222,6 +242,10 @@ void disas(FILE *out, void *code, unsigned long size)
print_insn = print_insn_sparc;
#elif defined(__arm__)
print_insn = print_insn_arm;
+#elif defined(__MIPSEB__)
+ print_insn = print_insn_big_mips;
+#elif defined(__MIPSEL__)
+ print_insn = print_insn_little_mips;
#else
fprintf(out, "0x%lx: Asm output not supported on this arch\n",
(long) code);
@@ -332,6 +356,8 @@ void monitor_disas(target_ulong pc, int nb_insn, int is_physical, int flags)
print_insn = print_insn_sparc;
#elif defined(TARGET_PPC)
print_insn = print_insn_ppc;
+#elif defined(TARGET_MIPS)
+ print_insn = print_insn_big_mips;
#else
term_printf("0x" TARGET_FMT_lx
": Asm output not supported on this arch\n", pc);