Print this page
4888 Undocument dma_req(9s)
4884 EOF scsi_hba_attach
4886 EOF ddi_dmae_getlim
4887 EOF ddi_iomin
4634 undocument scsi_hba_attach() and ddi_dma_lim(9s)
4630 clean stale references to ddi_iopb_alloc and ddi_iopb_free

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sun4/os/ddi_impl.c
          +++ new/usr/src/uts/sun4/os/ddi_impl.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 2009 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  /*
  27      - * Copyright 2012 Garrett D'Amore <garrett@damore.org>.  All rights reserved.
       27 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  28   28   */
  29   29  
  30   30  /*
  31   31   * sun4 specific DDI implementation
  32   32   */
  33   33  #include <sys/cpuvar.h>
  34   34  #include <sys/ddi_subrdefs.h>
  35   35  #include <sys/machsystm.h>
  36   36  #include <sys/sunndi.h>
  37   37  #include <sys/sysmacros.h>
↓ open down ↓ 1086 lines elided ↑ open up ↑
1124 1124  kfreea(void *addr)
1125 1125  {
1126 1126          size_t *saddr = addr;
1127 1127  
1128 1128          if (saddr[-3] == DDI_STRUCTURE_LE_ACC)
1129 1129                  vmem_free(little_endian_arena, (void *)saddr[-2], saddr[-1]);
1130 1130          else
1131 1131                  vmem_free(big_endian_arena, (void *)saddr[-2], saddr[-1]);
1132 1132  }
1133 1133  
     1134 +/*
     1135 + * This used to be ddi_iomin, but we were the only remaining caller, so
     1136 + * we've made it private and moved it here.
     1137 + */
     1138 +static int
     1139 +i_ddi_iomin(dev_info_t *a, int i, int stream)
     1140 +{
     1141 +        int r;
     1142 +
     1143 +        /*
     1144 +         * Make sure that the initial value is sane
     1145 +         */
     1146 +        if (i & (i - 1))
     1147 +                return (0);
     1148 +        if (i == 0)
     1149 +                i = (stream) ? 4 : 1;
     1150 +
     1151 +        r = ddi_ctlops(a, a,
     1152 +            DDI_CTLOPS_IOMIN, (void *)(uintptr_t)stream, (void *)&i);
     1153 +        if (r != DDI_SUCCESS || (i & (i - 1)))
     1154 +                return (0);
     1155 +        return (i);
     1156 +}
     1157 +
1134 1158  int
1135 1159  i_ddi_mem_alloc(dev_info_t *dip, ddi_dma_attr_t *attr,
1136 1160      size_t length, int cansleep, int flags,
1137 1161      ddi_device_acc_attr_t *accattrp,
1138 1162      caddr_t *kaddrp, size_t *real_length, ddi_acc_hdl_t *handlep)
1139 1163  {
1140 1164          caddr_t a;
1141 1165          int iomin, align, streaming;
1142 1166          uint_t endian_flags = DDI_NEVERSWAP_ACC;
1143 1167  
↓ open down ↓ 30 lines elided ↑ open up ↑
1174 1198          /*
1175 1199           * If a driver set burtsizes to 0, we give him byte alignment.
1176 1200           * Otherwise align at the burtsizes boundary.
1177 1201           */
1178 1202          if (iomin == 0)
1179 1203                  iomin = 1;
1180 1204          else
1181 1205                  iomin = 1 << (ddi_fls(iomin) - 1);
1182 1206          iomin = maxbit(iomin, attr->dma_attr_minxfer);
1183 1207          iomin = maxbit(iomin, attr->dma_attr_align);
1184      -        iomin = ddi_iomin(dip, iomin, streaming);
     1208 +        iomin = i_ddi_iomin(dip, iomin, streaming);
1185 1209          if (iomin == 0)
1186 1210                  return (DDI_FAILURE);
1187 1211  
1188 1212          ASSERT((iomin & (iomin - 1)) == 0);
1189 1213          ASSERT(iomin >= attr->dma_attr_minxfer);
1190 1214          ASSERT(iomin >= attr->dma_attr_align);
1191 1215  
1192 1216          length = P2ROUNDUP(length, iomin);
1193 1217          align = iomin;
1194 1218  
↓ open down ↓ 723 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX