Diff for /qemu/cris-dis.c between versions 1.1.1.3 and 1.1.1.7

version 1.1.1.3, 2018/04/24 17:20:40 version 1.1.1.7, 2018/04/24 19:34:19
Line 18 Line 18
    You should have received a copy of the GNU General Public License     You should have received a copy of the GNU General Public License
    along with this program; if not, see <http://www.gnu.org/licenses/>. */     along with this program; if not, see <http://www.gnu.org/licenses/>. */
   
   #include "qemu-common.h"
 #include "dis-asm.h"  #include "dis-asm.h"
 //#include "sysdep.h"  //#include "sysdep.h"
 #include "target-cris/opcode-cris.h"  #include "target-cris/opcode-cris.h"
 //#include "libiberty.h"  //#include "libiberty.h"
   
   
 void *qemu_malloc(size_t len); /* can't include qemu-common.h here */  
   
 #define FALSE 0  
 #define TRUE 1  
 #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)  #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
   
 /* cris-opc.c -- Table of opcodes for the CRIS processor.  /* cris-opc.c -- Table of opcodes for the CRIS processor.
Line 1320  cris_parse_disassembler_options (disasse Line 1316  cris_parse_disassembler_options (disasse
   info->private_data = calloc (1, sizeof (struct cris_disasm_data));    info->private_data = calloc (1, sizeof (struct cris_disasm_data));
   disdata = (struct cris_disasm_data *) info->private_data;    disdata = (struct cris_disasm_data *) info->private_data;
   if (disdata == NULL)    if (disdata == NULL)
     return FALSE;      return false;
   
   /* Default true.  */    /* Default true.  */
   disdata->trace_case    disdata->trace_case
Line 1328  cris_parse_disassembler_options (disasse Line 1324  cris_parse_disassembler_options (disasse
        || (strcmp (info->disassembler_options, "nocase") != 0));         || (strcmp (info->disassembler_options, "nocase") != 0));
   
   disdata->distype = distype;    disdata->distype = distype;
   return TRUE;    return true;
 }  }
   
 static const struct cris_spec_reg *  static const struct cris_spec_reg *
Line 1400  get_opcode_entry (unsigned int insn, Line 1396  get_opcode_entry (unsigned int insn,
   /* Allocate and clear the opcode-table.  */    /* Allocate and clear the opcode-table.  */
   if (opc_table == NULL)    if (opc_table == NULL)
     {      {
       opc_table = qemu_malloc (65536 * sizeof (opc_table[0]));        opc_table = g_new0(const struct cris_opcode *, 65536);
         dip_prefixes = g_new0(const struct cris_opcode *, 65536);
       memset (opc_table, 0, 65536 * sizeof (const struct cris_opcode *));        bdapq_m1_prefixes = g_new0(const struct cris_opcode *, 65536);
         bdapq_m2_prefixes = g_new0(const struct cris_opcode *, 65536);
       dip_prefixes        bdapq_m4_prefixes = g_new0(const struct cris_opcode *, 65536);
         = qemu_malloc (65536 * sizeof (const struct cris_opcode **));        rest_prefixes = g_new0(const struct cris_opcode *, 65536);
   
       memset (dip_prefixes, 0, 65536 * sizeof (dip_prefixes[0]));  
   
       bdapq_m1_prefixes  
         = qemu_malloc (65536 * sizeof (const struct cris_opcode **));  
   
       memset (bdapq_m1_prefixes, 0, 65536 * sizeof (bdapq_m1_prefixes[0]));  
   
       bdapq_m2_prefixes  
         = qemu_malloc (65536 * sizeof (const struct cris_opcode **));  
   
       memset (bdapq_m2_prefixes, 0, 65536 * sizeof (bdapq_m2_prefixes[0]));  
   
       bdapq_m4_prefixes  
         = qemu_malloc (65536 * sizeof (const struct cris_opcode **));  
   
       memset (bdapq_m4_prefixes, 0, 65536 * sizeof (bdapq_m4_prefixes[0]));  
   
       rest_prefixes  
         = qemu_malloc (65536 * sizeof (const struct cris_opcode **));  
   
       memset (rest_prefixes, 0, 65536 * sizeof (rest_prefixes[0]));  
     }      }
   
   /* Get the right table if this is a prefix.    /* Get the right table if this is a prefix.
Line 2771  print_insn_cris_generic (bfd_vma memaddr Line 2745  print_insn_cris_generic (bfd_vma memaddr
 }  }
   
 /* Disassemble, prefixing register names with `$'.  CRIS v0..v10.  */  /* Disassemble, prefixing register names with `$'.  CRIS v0..v10.  */
 #if 0  
 static int  static int
 print_insn_cris_with_register_prefix (bfd_vma vma,  print_insn_cris_with_register_prefix (bfd_vma vma,
                                       disassemble_info *info)                                        disassemble_info *info)
Line 2779  print_insn_cris_with_register_prefix (bf Line 2752  print_insn_cris_with_register_prefix (bf
   if (info->private_data == NULL    if (info->private_data == NULL
       && !cris_parse_disassembler_options (info, cris_dis_v0_v10))        && !cris_parse_disassembler_options (info, cris_dis_v0_v10))
     return -1;      return -1;
   return print_insn_cris_generic (vma, info, TRUE);    return print_insn_cris_generic (vma, info, true);
 }  }
 #endif  
 /* Disassemble, prefixing register names with `$'.  CRIS v32.  */  /* Disassemble, prefixing register names with `$'.  CRIS v32.  */
   
 static int  static int
Line 2791  print_insn_crisv32_with_register_prefix  Line 2763  print_insn_crisv32_with_register_prefix 
   if (info->private_data == NULL    if (info->private_data == NULL
       && !cris_parse_disassembler_options (info, cris_dis_v32))        && !cris_parse_disassembler_options (info, cris_dis_v32))
     return -1;      return -1;
   return print_insn_cris_generic (vma, info, TRUE);    return print_insn_cris_generic (vma, info, true);
 }  }
   
 #if 0  #if 0
Line 2805  print_insn_crisv10_v32_with_register_pre Line 2777  print_insn_crisv10_v32_with_register_pre
   if (info->private_data == NULL    if (info->private_data == NULL
       && !cris_parse_disassembler_options (info, cris_dis_common_v10_v32))        && !cris_parse_disassembler_options (info, cris_dis_common_v10_v32))
     return -1;      return -1;
   return print_insn_cris_generic (vma, info, TRUE);    return print_insn_cris_generic (vma, info, true);
 }  }
   
 /* Disassemble, no prefixes on register names.  CRIS v0..v10.  */  /* Disassemble, no prefixes on register names.  CRIS v0..v10.  */
Line 2817  print_insn_cris_without_register_prefix  Line 2789  print_insn_cris_without_register_prefix 
   if (info->private_data == NULL    if (info->private_data == NULL
       && !cris_parse_disassembler_options (info, cris_dis_v0_v10))        && !cris_parse_disassembler_options (info, cris_dis_v0_v10))
     return -1;      return -1;
   return print_insn_cris_generic (vma, info, FALSE);    return print_insn_cris_generic (vma, info, false);
 }  }
   
 /* Disassemble, no prefixes on register names.  CRIS v32.  */  /* Disassemble, no prefixes on register names.  CRIS v32.  */
Line 2829  print_insn_crisv32_without_register_pref Line 2801  print_insn_crisv32_without_register_pref
   if (info->private_data == NULL    if (info->private_data == NULL
       && !cris_parse_disassembler_options (info, cris_dis_v32))        && !cris_parse_disassembler_options (info, cris_dis_v32))
     return -1;      return -1;
   return print_insn_cris_generic (vma, info, FALSE);    return print_insn_cris_generic (vma, info, false);
 }  }
   
 /* Disassemble, no prefixes on register names.  /* Disassemble, no prefixes on register names.
Line 2842  print_insn_crisv10_v32_without_register_ Line 2814  print_insn_crisv10_v32_without_register_
   if (info->private_data == NULL    if (info->private_data == NULL
       && !cris_parse_disassembler_options (info, cris_dis_common_v10_v32))        && !cris_parse_disassembler_options (info, cris_dis_common_v10_v32))
     return -1;      return -1;
   return print_insn_cris_generic (vma, info, FALSE);    return print_insn_cris_generic (vma, info, false);
 }  }
 #endif  #endif
   
 int  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,  print_insn_crisv32 (bfd_vma vma,
                     disassemble_info *info)                      disassemble_info *info)
 {  {

Removed from v.1.1.1.3  
changed lines
  Added in v.1.1.1.7


unix.superglobalmegacorp.com