~jderose/ubuntu/raring/qemu/vde-again

« back to all changes in this revision

Viewing changes to cris-dis.c

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno, Aurelien Jarno
  • Date: 2009-03-22 10:13:17 UTC
  • mfrom: (1.2.1 upstream) (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090322101317-iigjtnu5qil35dtb
Tags: 0.10.1-1
[ Aurelien Jarno ]
* New upstream stable release:
  - patches/80_stable-branch.patch: remove.
* debian/control: 
  - Remove depends on proll.
  - Move depends on device-tree-compiler to build-depends.
  - Bump Standards-Version to 3.8.1 (no changes).
* patches/82_qemu-img_decimal.patch: new patch from upstream to make
  qemu-img accept sizes with decimal values (closes: bug#501400).

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
//#include "libiberty.h"
27
27
 
28
28
 
 
29
void *qemu_malloc(size_t len); /* can't include qemu-common.h here */
 
30
 
29
31
#define FALSE 0
30
32
#define TRUE 1
31
33
#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
1401
1403
  /* Allocate and clear the opcode-table.  */
1402
1404
  if (opc_table == NULL)
1403
1405
    {
1404
 
      opc_table = malloc (65536 * sizeof (opc_table[0]));
1405
 
      if (opc_table == NULL)
1406
 
        return NULL;
 
1406
      opc_table = qemu_malloc (65536 * sizeof (opc_table[0]));
1407
1407
 
1408
1408
      memset (opc_table, 0, 65536 * sizeof (const struct cris_opcode *));
1409
1409
 
1410
1410
      dip_prefixes
1411
 
        = malloc (65536 * sizeof (const struct cris_opcode **));
1412
 
      if (dip_prefixes == NULL)
1413
 
        return NULL;
 
1411
        = qemu_malloc (65536 * sizeof (const struct cris_opcode **));
1414
1412
 
1415
1413
      memset (dip_prefixes, 0, 65536 * sizeof (dip_prefixes[0]));
1416
1414
 
1417
1415
      bdapq_m1_prefixes
1418
 
        = malloc (65536 * sizeof (const struct cris_opcode **));
1419
 
      if (bdapq_m1_prefixes == NULL)
1420
 
        return NULL;
 
1416
        = qemu_malloc (65536 * sizeof (const struct cris_opcode **));
1421
1417
 
1422
1418
      memset (bdapq_m1_prefixes, 0, 65536 * sizeof (bdapq_m1_prefixes[0]));
1423
1419
 
1424
1420
      bdapq_m2_prefixes
1425
 
        = malloc (65536 * sizeof (const struct cris_opcode **));
1426
 
      if (bdapq_m2_prefixes == NULL)
1427
 
        return NULL;
 
1421
        = qemu_malloc (65536 * sizeof (const struct cris_opcode **));
1428
1422
 
1429
1423
      memset (bdapq_m2_prefixes, 0, 65536 * sizeof (bdapq_m2_prefixes[0]));
1430
1424
 
1431
1425
      bdapq_m4_prefixes
1432
 
        = malloc (65536 * sizeof (const struct cris_opcode **));
1433
 
      if (bdapq_m4_prefixes == NULL)
1434
 
        return NULL;
 
1426
        = qemu_malloc (65536 * sizeof (const struct cris_opcode **));
1435
1427
 
1436
1428
      memset (bdapq_m4_prefixes, 0, 65536 * sizeof (bdapq_m4_prefixes[0]));
1437
1429
 
1438
1430
      rest_prefixes
1439
 
        = malloc (65536 * sizeof (const struct cris_opcode **));
1440
 
      if (rest_prefixes == NULL)
1441
 
        return NULL;
 
1431
        = qemu_malloc (65536 * sizeof (const struct cris_opcode **));
1442
1432
 
1443
1433
      memset (rest_prefixes, 0, 65536 * sizeof (rest_prefixes[0]));
1444
1434
    }
2625
2615
     If we can't get any data, or we do not get enough data, we print
2626
2616
     the error message.  */
2627
2617
 
2628
 
  for (nbytes = MAX_BYTES_PER_CRIS_INSN; nbytes > 0; nbytes -= 2)
2629
 
    {
2630
 
      status = (*info->read_memory_func) (memaddr, buffer, nbytes, info);
2631
 
      if (status == 0)
2632
 
        break;
2633
 
    }
 
2618
  nbytes = info->buffer_length;
 
2619
  if (nbytes > MAX_BYTES_PER_CRIS_INSN)
 
2620
          nbytes = MAX_BYTES_PER_CRIS_INSN;
 
2621
  status = (*info->read_memory_func) (memaddr, buffer, nbytes, info);  
2634
2622
 
2635
2623
  /* If we did not get all we asked for, then clear the rest.
2636
2624
     Hopefully this makes a reproducible result in case of errors.  */