Print this page
fixup dis_min_instrlen
take to dis and libdisasm with an axe; does not yet compile

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libdisasm/common/libdisasm_impl.h
          +++ new/usr/src/lib/libdisasm/common/libdisasm_impl.h
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
       25 + * Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
  25   26   */
  26   27  
  27   28  #ifndef _LIBDISASM_IMPL_H
  28   29  #define _LIBDISASM_IMPL_H
  29   30  
  30      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  31      -
  32   31  #ifdef  __cplusplus
  33   32  extern "C" {
  34   33  #endif
  35   34  
       35 +typedef struct dis_arch {
       36 +        int (*da_supports_flags)(int);
       37 +        int (*da_handle_attach)(dis_handle_t *);
       38 +        void (*da_handle_detach)(dis_handle_t *);
       39 +        int (*da_disassemble)(dis_handle_t *, uint64_t, char *, size_t);
       40 +        uint64_t (*da_previnstr)(dis_handle_t *, uint64_t, int n);
       41 +        int (*da_min_instrlen)(dis_handle_t *);
       42 +        int (*da_max_instrlen)(dis_handle_t *);
       43 +} dis_arch_t;
       44 +
       45 +struct dis_handle {
       46 +        void            *dh_data;
       47 +        int             dh_flags;
       48 +        dis_lookup_f    dh_lookup;
       49 +        dis_read_f      dh_read;
       50 +        uint64_t        dh_addr;
       51 +
       52 +        dis_arch_t      *dh_arch;
       53 +        void            *dh_arch_private;
       54 +};
       55 +
  36   56  extern int dis_seterrno(int);
  37   57  
  38   58  extern void *dis_zalloc(size_t);
  39   59  extern void dis_free(void *, size_t);
  40   60  
  41   61  #ifdef  __cplusplus
  42   62  }
  43   63  #endif
  44   64  
  45   65  #endif  /* _LIBDISASM_IMPL_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX