Print this page
OS-7095 Want risc-v disassembler

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libdisasm/common/libdisasm.c
          +++ new/usr/src/lib/libdisasm/common/libdisasm.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  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   25   * Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
  26   26   * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
       27 + * Copyright 2018, Joyent, Inc.
  27   28   */
  28   29  
  29   30  #include <libdisasm.h>
  30   31  #include <stdlib.h>
  31   32  #ifdef DIS_STANDALONE
  32   33  #include <mdb/mdb_modapi.h>
  33   34  #define _MDB
  34   35  #include <mdb/mdb_io.h>
  35   36  #else
  36   37  #include <stdio.h>
↓ open down ↓ 11 lines elided ↑ open up ↑
  48   49   */
  49   50  #if !defined(DIS_STANDALONE) || defined(__i386) || defined(__amd64)
  50   51  extern dis_arch_t dis_arch_i386;
  51   52  #endif
  52   53  #if !defined(DIS_STANDALONE) || defined(__sparc)
  53   54  extern dis_arch_t dis_arch_sparc;
  54   55  #endif
  55   56  #if !defined(DIS_STANDALONE) || defined(__s390) || defined(__s390x)
  56   57  extern dis_arch_t dis_arch_s390;
  57   58  #endif
       59 +#if !defined(DIS_STANDALONE) || defined(__riscv)
       60 +extern dis_arch_t dis_arch_riscv;
       61 +#endif
  58   62  
  59   63  static dis_arch_t *dis_archs[] = {
  60   64  #if !defined(DIS_STANDALONE) || defined(__i386) || defined(__amd64)
  61   65          &dis_arch_i386,
  62   66  #endif
  63   67  #if !defined(DIS_STANDALONE) || defined(__sparc)
  64   68          &dis_arch_sparc,
  65   69  #endif
  66   70  #if !defined(DIS_STANDALONE) || defined(__s390) || defined(__s390x)
  67   71          &dis_arch_s390,
  68   72  #endif
       73 +#if !defined(DIS_STANDALONE) || defined(__riscv)
       74 +        &dis_arch_riscv,
       75 +#endif
  69   76          NULL
  70   77  };
  71   78  
  72   79  /*
  73   80   * For the standalone library, we need to link against mdb's malloc/free.
  74   81   * Otherwise, use the standard malloc/free.
  75   82   */
  76   83  #ifdef DIS_STANDALONE
  77   84  void *
  78   85  dis_zalloc(size_t bytes)
↓ open down ↓ 245 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX