cris: Support disassembly of crisv10
authorEdgar E. Iglesias <edgar@axis.com>
Mon, 10 Jan 2011 21:31:09 +0000 (22:31 +0100)
committerEdgar E. Iglesias <edgar@axis.com>
Mon, 10 Jan 2011 21:31:09 +0000 (22:31 +0100)
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
cris-dis.c
dis-asm.h
disas.c

index afd775c29b23fe25aedb5a717c08eccb87368ea1..5fa67d9f29799d60b1ba0d9c645dcbe4bd2492b5 100644 (file)
@@ -2767,7 +2767,6 @@ print_insn_cris_generic (bfd_vma memaddr,
 }
 
 /* Disassemble, prefixing register names with `$'.  CRIS v0..v10.  */
-#if 0
 static int
 print_insn_cris_with_register_prefix (bfd_vma vma,
                                      disassemble_info *info)
@@ -2777,7 +2776,6 @@ print_insn_cris_with_register_prefix (bfd_vma vma,
     return -1;
   return print_insn_cris_generic (vma, info, true);
 }
-#endif
 /* Disassemble, prefixing register names with `$'.  CRIS v32.  */
 
 static int
@@ -2842,6 +2840,13 @@ print_insn_crisv10_v32_without_register_prefix (bfd_vma vma,
 }
 #endif
 
+int
+print_insn_crisv10 (bfd_vma vma,
+                   disassemble_info *info)
+{
+  return print_insn_cris_with_register_prefix(vma, info);
+}
+
 int
 print_insn_crisv32 (bfd_vma vma,
                    disassemble_info *info)
index 3fb483815accdc59f6e308d61ed93f867d2ba7f8..356459c5fd6e8dc99c1b5195f1ee301543727c09 100644 (file)
--- a/dis-asm.h
+++ b/dis-asm.h
@@ -397,6 +397,7 @@ extern int print_insn_tic30         (bfd_vma, disassemble_info*);
 extern int print_insn_ppc              (bfd_vma, disassemble_info*);
 extern int print_insn_s390             (bfd_vma, disassemble_info*);
 extern int print_insn_crisv32           (bfd_vma, disassemble_info*);
+extern int print_insn_crisv10           (bfd_vma, disassemble_info*);
 extern int print_insn_microblaze        (bfd_vma, disassemble_info*);
 extern int print_insn_ia64              (bfd_vma, disassemble_info*);
 
diff --git a/disas.c b/disas.c
index afe331fdb92ec30a8f7976d15dd77de7aaf02ccf..dd2db142d764c25fecdb761e4ee0b5c322a82e04 100644 (file)
--- a/disas.c
+++ b/disas.c
@@ -208,8 +208,13 @@ void target_disas(FILE *out, target_ulong code, target_ulong size, int flags)
     disasm_info.mach = bfd_mach_alpha;
     print_insn = print_insn_alpha;
 #elif defined(TARGET_CRIS)
-    disasm_info.mach = bfd_mach_cris_v32;
-    print_insn = print_insn_crisv32;
+    if (flags != 32) {
+        disasm_info.mach = bfd_mach_cris_v0_v10;
+        print_insn = print_insn_crisv10;
+    } else {
+        disasm_info.mach = bfd_mach_cris_v32;
+        print_insn = print_insn_crisv32;
+    }
 #elif defined(TARGET_MICROBLAZE)
     disasm_info.mach = bfd_arch_microblaze;
     print_insn = print_insn_microblaze;