Diff for /qemu/dis-asm.h between versions 1.1.1.3 and 1.1.1.11

version 1.1.1.3, 2018/04/24 16:40:38 version 1.1.1.11, 2018/04/24 19:17:06
Line 9 Line 9
 #ifndef DIS_ASM_H  #ifndef DIS_ASM_H
 #define DIS_ASM_H  #define DIS_ASM_H
   
 #include <stdlib.h>  #include "qemu-common.h"
 #include <stdio.h>  
 #include <string.h>  
 #include <inttypes.h>  
   
 #define PARAMS(x) x  
 typedef void *PTR;  typedef void *PTR;
 typedef uint64_t bfd_vma;  typedef uint64_t bfd_vma;
 typedef int64_t bfd_signed_vma;  typedef int64_t bfd_signed_vma;
 typedef uint8_t bfd_byte;  typedef uint8_t bfd_byte;
 #define sprintf_vma(s,x) sprintf (s, "%0" PRIx64, x)  #define sprintf_vma(s,x) sprintf (s, "%0" PRIx64, x)
   #define snprintf_vma(s,ss,x) snprintf (s, ss, "%0" PRIx64, x)
   
 #define BFD64  #define BFD64
   
Line 44  enum bfd_flavour { Line 41  enum bfd_flavour {
   
 enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };  enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
   
 enum bfd_architecture   enum bfd_architecture
 {  {
   bfd_arch_unknown,    /* File arch not known */    bfd_arch_unknown,    /* File arch not known */
   bfd_arch_obscure,    /* Arch known, not one of these */    bfd_arch_obscure,    /* Arch known, not one of these */
Line 67  enum bfd_architecture  Line 64  enum bfd_architecture 
 #define bfd_mach_mcf5249   16  #define bfd_mach_mcf5249   16
 #define bfd_mach_mcf547x   17  #define bfd_mach_mcf547x   17
 #define bfd_mach_mcf548x   18  #define bfd_mach_mcf548x   18
   bfd_arch_vax,        /* DEC Vax */       bfd_arch_vax,        /* DEC Vax */
   bfd_arch_i960,       /* Intel 960 */    bfd_arch_i960,       /* Intel 960 */
      /* The order of the following is important.       /* The order of the following is important.
        lower number indicates a machine type that          lower number indicates a machine type that
        only accepts a subset of the instructions         only accepts a subset of the instructions
        available to machines with higher numbers.         available to machines with higher numbers.
        The exception is the "ca", which is         The exception is the "ca", which is
        incompatible with all other machines except          incompatible with all other machines except
        "core". */         "core". */
   
 #define bfd_mach_i960_core      1  #define bfd_mach_i960_core      1
Line 141  enum bfd_architecture  Line 138  enum bfd_architecture 
 #define bfd_mach_ppc64         1  #define bfd_mach_ppc64         1
 #define bfd_mach_ppc_403       403  #define bfd_mach_ppc_403       403
 #define bfd_mach_ppc_403gc     4030  #define bfd_mach_ppc_403gc     4030
   #define bfd_mach_ppc_e500      500
 #define bfd_mach_ppc_505       505  #define bfd_mach_ppc_505       505
 #define bfd_mach_ppc_601       601  #define bfd_mach_ppc_601       601
 #define bfd_mach_ppc_602       602  #define bfd_mach_ppc_602       602
Line 157  enum bfd_architecture  Line 155  enum bfd_architecture 
 #define bfd_mach_ppc_7400      7400  #define bfd_mach_ppc_7400      7400
   bfd_arch_rs6000,     /* IBM RS/6000 */    bfd_arch_rs6000,     /* IBM RS/6000 */
   bfd_arch_hppa,       /* HP PA RISC */    bfd_arch_hppa,       /* HP PA RISC */
   #define bfd_mach_hppa10        10
   #define bfd_mach_hppa11        11
   #define bfd_mach_hppa20        20
   #define bfd_mach_hppa20w       25
   bfd_arch_d10v,       /* Mitsubishi D10V */    bfd_arch_d10v,       /* Mitsubishi D10V */
   bfd_arch_z8k,        /* Zilog Z8000 */    bfd_arch_z8k,        /* Zilog Z8000 */
 #define bfd_mach_z8001         1  #define bfd_mach_z8001         1
Line 181  enum bfd_architecture  Line 183  enum bfd_architecture 
 #define bfd_mach_sh4al_dsp  0x4d  #define bfd_mach_sh4al_dsp  0x4d
 #define bfd_mach_sh5        0x50  #define bfd_mach_sh5        0x50
   bfd_arch_alpha,      /* Dec Alpha */    bfd_arch_alpha,      /* Dec Alpha */
   #define bfd_mach_alpha 1
   #define bfd_mach_alpha_ev4  0x10
   #define bfd_mach_alpha_ev5  0x20
   #define bfd_mach_alpha_ev6  0x30
   bfd_arch_arm,        /* Advanced Risc Machines ARM */    bfd_arch_arm,        /* Advanced Risc Machines ARM */
 #define bfd_mach_arm_2         1  #define bfd_mach_arm_unknown    0
 #define bfd_mach_arm_2a                2  #define bfd_mach_arm_2          1
 #define bfd_mach_arm_3         3  #define bfd_mach_arm_2a         2
 #define bfd_mach_arm_3M        4  #define bfd_mach_arm_3          3
 #define bfd_mach_arm_4                 5  #define bfd_mach_arm_3M         4
 #define bfd_mach_arm_4T        6  #define bfd_mach_arm_4          5
   #define bfd_mach_arm_4T         6
   #define bfd_mach_arm_5          7
   #define bfd_mach_arm_5T         8
   #define bfd_mach_arm_5TE        9
   #define bfd_mach_arm_XScale     10
   #define bfd_mach_arm_ep9312     11
   #define bfd_mach_arm_iWMMXt     12
   #define bfd_mach_arm_iWMMXt2    13
   bfd_arch_ns32k,      /* National Semiconductors ns32000 */    bfd_arch_ns32k,      /* National Semiconductors ns32000 */
   bfd_arch_w65,        /* WDC 65816 */    bfd_arch_w65,        /* WDC 65816 */
   bfd_arch_tic30,      /* Texas Instruments TMS320C30 */    bfd_arch_tic30,      /* Texas Instruments TMS320C30 */
Line 199  enum bfd_architecture  Line 213  enum bfd_architecture 
 #define bfd_mach_m32r          0  /* backwards compatibility */  #define bfd_mach_m32r          0  /* backwards compatibility */
   bfd_arch_mn10200,    /* Matsushita MN10200 */    bfd_arch_mn10200,    /* Matsushita MN10200 */
   bfd_arch_mn10300,    /* Matsushita MN10300 */    bfd_arch_mn10300,    /* Matsushita MN10300 */
     bfd_arch_cris,       /* Axis CRIS */
   #define bfd_mach_cris_v0_v10   255
   #define bfd_mach_cris_v32      32
   #define bfd_mach_cris_v10_v32  1032
     bfd_arch_microblaze, /* Xilinx MicroBlaze.  */
     bfd_arch_ia64,      /* HP/Intel ia64 */
   #define bfd_mach_ia64_elf64    64
   #define bfd_mach_ia64_elf32    32
   bfd_arch_last    bfd_arch_last
   };    };
   #define bfd_mach_s390_31 31
   #define bfd_mach_s390_64 64
   
 typedef struct symbol_cache_entry  typedef struct symbol_cache_entry
 {  {
Line 212  typedef struct symbol_cache_entry Line 236  typedef struct symbol_cache_entry
     } udata;      } udata;
 } asymbol;  } asymbol;
   
 typedef int (*fprintf_ftype) PARAMS((FILE*, const char*, ...));  
   
 enum dis_insn_type {  enum dis_insn_type {
   dis_noninsn,                  /* Not a valid instruction */    dis_noninsn,                  /* Not a valid instruction */
   dis_nonbranch,                /* Not a branch instruction */    dis_nonbranch,                /* Not a branch instruction */
Line 225  enum dis_insn_type { Line 247  enum dis_insn_type {
   dis_dref2                     /* Two data references in instruction */    dis_dref2                     /* Two data references in instruction */
 };  };
   
 /* This struct is passed into the instruction decoding routine,   /* This struct is passed into the instruction decoding routine,
    and is passed back out into each callback.  The various fields are used     and is passed back out into each callback.  The various fields are used
    for conveying information from your main routine into your callbacks,     for conveying information from your main routine into your callbacks,
    for passing information into the instruction decoders (such as the     for passing information into the instruction decoders (such as the
Line 236  enum dis_insn_type { Line 258  enum dis_insn_type {
    by hand, or using one of the initialization macros below.  */     by hand, or using one of the initialization macros below.  */
   
 typedef struct disassemble_info {  typedef struct disassemble_info {
   fprintf_ftype fprintf_func;    fprintf_function fprintf_func;
   FILE *stream;    FILE *stream;
   PTR application_data;    PTR application_data;
   
Line 274  typedef struct disassemble_info { Line 296  typedef struct disassemble_info {
      INFO is a pointer to this struct.       INFO is a pointer to this struct.
      Returns an errno value or 0 for success.  */       Returns an errno value or 0 for success.  */
   int (*read_memory_func)    int (*read_memory_func)
     PARAMS ((bfd_vma memaddr, bfd_byte *myaddr, int length,      (bfd_vma memaddr, bfd_byte *myaddr, int length,
              struct disassemble_info *info));               struct disassemble_info *info);
   
   /* Function which should be called if we get an error that we can't    /* Function which should be called if we get an error that we can't
      recover from.  STATUS is the errno value from read_memory_func and       recover from.  STATUS is the errno value from read_memory_func and
      MEMADDR is the address that we were trying to read.  INFO is a       MEMADDR is the address that we were trying to read.  INFO is a
      pointer to this struct.  */       pointer to this struct.  */
   void (*memory_error_func)    void (*memory_error_func)
     PARAMS ((int status, bfd_vma memaddr, struct disassemble_info *info));      (int status, bfd_vma memaddr, struct disassemble_info *info);
   
   /* Function called to print ADDR.  */    /* Function called to print ADDR.  */
   void (*print_address_func)    void (*print_address_func)
     PARAMS ((bfd_vma addr, struct disassemble_info *info));      (bfd_vma addr, struct disassemble_info *info);
   
   /* Function called to determine if there is a symbol at the given ADDR.    /* Function called to determine if there is a symbol at the given ADDR.
      If there is, the function returns 1, otherwise it returns 0.       If there is, the function returns 1, otherwise it returns 0.
Line 296  typedef struct disassemble_info { Line 318  typedef struct disassemble_info {
      address, (normally because there is a symbol associated with       address, (normally because there is a symbol associated with
      that address), but sometimes we want to mask out the overlay bits.  */       that address), but sometimes we want to mask out the overlay bits.  */
   int (* symbol_at_address_func)    int (* symbol_at_address_func)
     PARAMS ((bfd_vma addr, struct disassemble_info * info));      (bfd_vma addr, struct disassemble_info * info);
   
   /* These are for buffer_read_memory.  */    /* These are for buffer_read_memory.  */
   bfd_byte *buffer;    bfd_byte *buffer;
Line 341  typedef struct disassemble_info { Line 363  typedef struct disassemble_info {
   
 /* Standard disassemblers.  Disassemble one instruction at the given  /* Standard disassemblers.  Disassemble one instruction at the given
    target address.  Return number of bytes processed.  */     target address.  Return number of bytes processed.  */
 typedef int (*disassembler_ftype)  typedef int (*disassembler_ftype) (bfd_vma, disassemble_info *);
      PARAMS((bfd_vma, disassemble_info *));  
   
 extern int print_insn_big_mips          PARAMS ((bfd_vma, disassemble_info*));  int print_insn_tci(bfd_vma, disassemble_info*);
 extern int print_insn_little_mips       PARAMS ((bfd_vma, disassemble_info*));  int print_insn_big_mips         (bfd_vma, disassemble_info*);
 extern int print_insn_i386              PARAMS ((bfd_vma, disassemble_info*));  int print_insn_little_mips      (bfd_vma, disassemble_info*);
 extern int print_insn_m68k              PARAMS ((bfd_vma, disassemble_info*));  int print_insn_i386             (bfd_vma, disassemble_info*);
 extern int print_insn_z8001             PARAMS ((bfd_vma, disassemble_info*));  int print_insn_m68k             (bfd_vma, disassemble_info*);
 extern int print_insn_z8002             PARAMS ((bfd_vma, disassemble_info*));  int print_insn_z8001            (bfd_vma, disassemble_info*);
 extern int print_insn_h8300             PARAMS ((bfd_vma, disassemble_info*));  int print_insn_z8002            (bfd_vma, disassemble_info*);
 extern int print_insn_h8300h            PARAMS ((bfd_vma, disassemble_info*));  int print_insn_h8300            (bfd_vma, disassemble_info*);
 extern int print_insn_h8300s            PARAMS ((bfd_vma, disassemble_info*));  int print_insn_h8300h           (bfd_vma, disassemble_info*);
 extern int print_insn_h8500             PARAMS ((bfd_vma, disassemble_info*));  int print_insn_h8300s           (bfd_vma, disassemble_info*);
 extern int print_insn_alpha             PARAMS ((bfd_vma, disassemble_info*));  int print_insn_h8500            (bfd_vma, disassemble_info*);
 extern disassembler_ftype arc_get_disassembler PARAMS ((int, int));  int print_insn_alpha            (bfd_vma, disassemble_info*);
 extern int print_insn_arm               PARAMS ((bfd_vma, disassemble_info*));  disassembler_ftype arc_get_disassembler (int, int);
 extern int print_insn_sparc             PARAMS ((bfd_vma, disassemble_info*));  int print_insn_arm              (bfd_vma, disassemble_info*);
 extern int print_insn_big_a29k          PARAMS ((bfd_vma, disassemble_info*));  int print_insn_sparc            (bfd_vma, disassemble_info*);
 extern int print_insn_little_a29k       PARAMS ((bfd_vma, disassemble_info*));  int print_insn_big_a29k         (bfd_vma, disassemble_info*);
 extern int print_insn_i960              PARAMS ((bfd_vma, disassemble_info*));  int print_insn_little_a29k      (bfd_vma, disassemble_info*);
 extern int print_insn_sh                PARAMS ((bfd_vma, disassemble_info*));  int print_insn_i960             (bfd_vma, disassemble_info*);
 extern int print_insn_shl               PARAMS ((bfd_vma, disassemble_info*));  int print_insn_sh               (bfd_vma, disassemble_info*);
 extern int print_insn_hppa              PARAMS ((bfd_vma, disassemble_info*));  int print_insn_shl              (bfd_vma, disassemble_info*);
 extern int print_insn_m32r              PARAMS ((bfd_vma, disassemble_info*));  int print_insn_hppa             (bfd_vma, disassemble_info*);
 extern int print_insn_m88k              PARAMS ((bfd_vma, disassemble_info*));  int print_insn_m32r             (bfd_vma, disassemble_info*);
 extern int print_insn_mn10200           PARAMS ((bfd_vma, disassemble_info*));  int print_insn_m88k             (bfd_vma, disassemble_info*);
 extern int print_insn_mn10300           PARAMS ((bfd_vma, disassemble_info*));  int print_insn_mn10200          (bfd_vma, disassemble_info*);
 extern int print_insn_ns32k             PARAMS ((bfd_vma, disassemble_info*));  int print_insn_mn10300          (bfd_vma, disassemble_info*);
 extern int print_insn_big_powerpc       PARAMS ((bfd_vma, disassemble_info*));  int print_insn_ns32k            (bfd_vma, disassemble_info*);
 extern int print_insn_little_powerpc    PARAMS ((bfd_vma, disassemble_info*));  int print_insn_big_powerpc      (bfd_vma, disassemble_info*);
 extern int print_insn_rs6000            PARAMS ((bfd_vma, disassemble_info*));  int print_insn_little_powerpc   (bfd_vma, disassemble_info*);
 extern int print_insn_w65               PARAMS ((bfd_vma, disassemble_info*));  int print_insn_rs6000           (bfd_vma, disassemble_info*);
 extern int print_insn_d10v              PARAMS ((bfd_vma, disassemble_info*));  int print_insn_w65              (bfd_vma, disassemble_info*);
 extern int print_insn_v850              PARAMS ((bfd_vma, disassemble_info*));  int print_insn_d10v             (bfd_vma, disassemble_info*);
 extern int print_insn_tic30             PARAMS ((bfd_vma, disassemble_info*));  int print_insn_v850             (bfd_vma, disassemble_info*);
 extern int print_insn_ppc               PARAMS ((bfd_vma, disassemble_info*));  int print_insn_tic30            (bfd_vma, disassemble_info*);
   int print_insn_ppc              (bfd_vma, disassemble_info*);
   int print_insn_s390             (bfd_vma, disassemble_info*);
   int print_insn_crisv32          (bfd_vma, disassemble_info*);
   int print_insn_crisv10          (bfd_vma, disassemble_info*);
   int print_insn_microblaze       (bfd_vma, disassemble_info*);
   int print_insn_ia64             (bfd_vma, disassemble_info*);
   
 #if 0  #if 0
 /* Fetch the disassembler for a given BFD, if that support is available.  */  /* Fetch the disassembler for a given BFD, if that support is available.  */
 extern disassembler_ftype disassembler  PARAMS ((bfd *));  disassembler_ftype disassembler(bfd *);
 #endif  #endif
   
   
Line 389  extern disassembler_ftype disassembler P Line 416  extern disassembler_ftype disassembler P
   
 /* Here is a function which callers may wish to use for read_memory_func.  /* Here is a function which callers may wish to use for read_memory_func.
    It gets bytes from a buffer.  */     It gets bytes from a buffer.  */
 extern int buffer_read_memory  int buffer_read_memory(bfd_vma, bfd_byte *, int, struct disassemble_info *);
   PARAMS ((bfd_vma, bfd_byte *, int, struct disassemble_info *));  
   
 /* This function goes with buffer_read_memory.  /* This function goes with buffer_read_memory.
    It prints a message using info->fprintf_func and info->stream.  */     It prints a message using info->fprintf_func and info->stream.  */
 extern void perror_memory PARAMS ((int, bfd_vma, struct disassemble_info *));  void perror_memory(int, bfd_vma, struct disassemble_info *);
   
   
 /* Just print the address in hex.  This is included for completeness even  /* Just print the address in hex.  This is included for completeness even
    though both GDB and objdump provide their own (to print symbolic     though both GDB and objdump provide their own (to print symbolic
    addresses).  */     addresses).  */
 extern void generic_print_address  void generic_print_address(bfd_vma, struct disassemble_info *);
   PARAMS ((bfd_vma, struct disassemble_info *));  
   
 /* Always true.  */  /* Always true.  */
 extern int generic_symbol_at_address  int generic_symbol_at_address(bfd_vma, struct disassemble_info *);
   PARAMS ((bfd_vma, struct disassemble_info *));  
   
 /* Macro to initialize a disassemble_info struct.  This should be called  /* Macro to initialize a disassemble_info struct.  This should be called
    by all applications creating such a struct.  */     by all applications creating such a struct.  */
Line 419  extern int generic_symbol_at_address Line 443  extern int generic_symbol_at_address
 /* Call this macro to initialize only the internal variables for the  /* Call this macro to initialize only the internal variables for the
    disassembler.  Architecture dependent things such as byte order, or machine     disassembler.  Architecture dependent things such as byte order, or machine
    variant are not touched by this macro.  This makes things much easier for     variant are not touched by this macro.  This makes things much easier for
    GDB which must initialize these things seperatly.  */     GDB which must initialize these things separately.  */
   
 #define INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC) \  #define INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC) \
   (INFO).fprintf_func = (FPRINTF_FUNC), \    (INFO).fprintf_func = (FPRINTF_FUNC), \
   (INFO).stream = (STREAM), \    (INFO).stream = (STREAM), \
   (INFO).symbols = NULL, \    (INFO).symbols = NULL, \
   (INFO).num_symbols = 0, \    (INFO).num_symbols = 0, \
     (INFO).private_data = NULL, \
   (INFO).buffer = NULL, \    (INFO).buffer = NULL, \
   (INFO).buffer_vma = 0, \    (INFO).buffer_vma = 0, \
   (INFO).buffer_length = 0, \    (INFO).buffer_length = 0, \
Line 445  extern int generic_symbol_at_address Line 470  extern int generic_symbol_at_address
   
 /* from libbfd */  /* from libbfd */
   
   bfd_vma bfd_getl64 (const bfd_byte *addr);
 bfd_vma bfd_getl32 (const bfd_byte *addr);  bfd_vma bfd_getl32 (const bfd_byte *addr);
 bfd_vma bfd_getb32 (const bfd_byte *addr);  bfd_vma bfd_getb32 (const bfd_byte *addr);
 bfd_vma bfd_getl16 (const bfd_byte *addr);  bfd_vma bfd_getl16 (const bfd_byte *addr);
 bfd_vma bfd_getb16 (const bfd_byte *addr);  bfd_vma bfd_getb16 (const bfd_byte *addr);
 typedef enum bfd_boolean {false, true} boolean;  typedef bool bfd_boolean;
 typedef boolean bfd_boolean;  
   
 #endif /* ! defined (DIS_ASM_H) */  #endif /* ! defined (DIS_ASM_H) */

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


unix.superglobalmegacorp.com