Diff for /qemu/cris-dis.c between versions 1.1.1.1 and 1.1.1.4

version 1.1.1.1, 2018/04/24 16:47:18 version 1.1.1.4, 2018/04/24 17:34:18
Line 16 Line 16
    more details.     more details.
   
    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, write to the Free Software     along with this program; if not, see <http://www.gnu.org/licenses/>. */
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,  
    MA 02110-1301, USA.  */  
   
 #include "dis-asm.h"  #include "dis-asm.h"
 //#include "sysdep.h"  //#include "sysdep.h"
Line 26 Line 24
 //#include "libiberty.h"  //#include "libiberty.h"
   
   
 #define FALSE 0  void *qemu_malloc(size_t len); /* can't include qemu-common.h here */
 #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 49  MERCHANTABILITY or FITNESS FOR A PARTICU Line 47  MERCHANTABILITY or FITNESS FOR A PARTICU
 GNU General Public License for more details.  GNU General Public License for more details.
   
 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, write to the Free Software  along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */  
   
 #ifndef NULL  #ifndef NULL
 #define NULL (0)  #define NULL (0)
Line 1321  cris_parse_disassembler_options (disasse Line 1318  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 1329  cris_parse_disassembler_options (disasse Line 1326  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 1401  get_opcode_entry (unsigned int insn, Line 1398  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 = malloc (65536 * sizeof (opc_table[0]));        opc_table = qemu_malloc (65536 * sizeof (opc_table[0]));
       if (opc_table == NULL)  
         return NULL;  
   
       memset (opc_table, 0, 65536 * sizeof (const struct cris_opcode *));        memset (opc_table, 0, 65536 * sizeof (const struct cris_opcode *));
   
       dip_prefixes        dip_prefixes
         = malloc (65536 * sizeof (const struct cris_opcode **));          = qemu_malloc (65536 * sizeof (const struct cris_opcode **));
       if (dip_prefixes == NULL)  
         return NULL;  
   
       memset (dip_prefixes, 0, 65536 * sizeof (dip_prefixes[0]));        memset (dip_prefixes, 0, 65536 * sizeof (dip_prefixes[0]));
   
       bdapq_m1_prefixes        bdapq_m1_prefixes
         = malloc (65536 * sizeof (const struct cris_opcode **));          = qemu_malloc (65536 * sizeof (const struct cris_opcode **));
       if (bdapq_m1_prefixes == NULL)  
         return NULL;  
   
       memset (bdapq_m1_prefixes, 0, 65536 * sizeof (bdapq_m1_prefixes[0]));        memset (bdapq_m1_prefixes, 0, 65536 * sizeof (bdapq_m1_prefixes[0]));
   
       bdapq_m2_prefixes        bdapq_m2_prefixes
         = malloc (65536 * sizeof (const struct cris_opcode **));          = qemu_malloc (65536 * sizeof (const struct cris_opcode **));
       if (bdapq_m2_prefixes == NULL)  
         return NULL;  
   
       memset (bdapq_m2_prefixes, 0, 65536 * sizeof (bdapq_m2_prefixes[0]));        memset (bdapq_m2_prefixes, 0, 65536 * sizeof (bdapq_m2_prefixes[0]));
   
       bdapq_m4_prefixes        bdapq_m4_prefixes
         = malloc (65536 * sizeof (const struct cris_opcode **));          = qemu_malloc (65536 * sizeof (const struct cris_opcode **));
       if (bdapq_m4_prefixes == NULL)  
         return NULL;  
   
       memset (bdapq_m4_prefixes, 0, 65536 * sizeof (bdapq_m4_prefixes[0]));        memset (bdapq_m4_prefixes, 0, 65536 * sizeof (bdapq_m4_prefixes[0]));
   
       rest_prefixes        rest_prefixes
         = malloc (65536 * sizeof (const struct cris_opcode **));          = qemu_malloc (65536 * sizeof (const struct cris_opcode **));
       if (rest_prefixes == NULL)  
         return NULL;  
   
       memset (rest_prefixes, 0, 65536 * sizeof (rest_prefixes[0]));        memset (rest_prefixes, 0, 65536 * sizeof (rest_prefixes[0]));
     }      }
Line 2625  print_insn_cris_generic (bfd_vma memaddr Line 2610  print_insn_cris_generic (bfd_vma memaddr
      If we can't get any data, or we do not get enough data, we print       If we can't get any data, or we do not get enough data, we print
      the error message.  */       the error message.  */
   
   for (nbytes = MAX_BYTES_PER_CRIS_INSN; nbytes > 0; nbytes -= 2)    nbytes = info->buffer_length;
     {    if (nbytes > MAX_BYTES_PER_CRIS_INSN)
       status = (*info->read_memory_func) (memaddr, buffer, nbytes, info);            nbytes = MAX_BYTES_PER_CRIS_INSN;
       if (status == 0)    status = (*info->read_memory_func) (memaddr, buffer, nbytes, info);  
         break;  
     }  
   
   /* If we did not get all we asked for, then clear the rest.    /* If we did not get all we asked for, then clear the rest.
      Hopefully this makes a reproducible result in case of errors.  */       Hopefully this makes a reproducible result in case of errors.  */
Line 2794  print_insn_cris_with_register_prefix (bf Line 2777  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  #endif
 /* Disassemble, prefixing register names with `$'.  CRIS v32.  */  /* Disassemble, prefixing register names with `$'.  CRIS v32.  */
Line 2806  print_insn_crisv32_with_register_prefix  Line 2789  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 2820  print_insn_crisv10_v32_with_register_pre Line 2803  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 2832  print_insn_cris_without_register_prefix  Line 2815  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 2844  print_insn_crisv32_without_register_pref Line 2827  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 2857  print_insn_crisv10_v32_without_register_ Line 2840  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
   

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.4


unix.superglobalmegacorp.com