Print this page
5042 stop using deprecated atomic functions

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/multidata.c
          +++ new/usr/src/uts/common/io/multidata.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
  23   23   * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  28      -
  29   27  /*
  30   28   * Multidata, as described in the following papers:
  31   29   *
  32   30   * Adi Masputra,
  33   31   * Multidata V.2: VA-Disjoint Packet Extents Framework Interface
  34   32   * Design Specification.  August 2004.
  35   33   * Available as http://sac.sfbay/PSARC/2004/594/materials/mmd2.pdf.
  36   34   *
  37   35   * Adi Masputra,
  38   36   * Multidata Interface Design Specification.  Sep 2002.
↓ open down ↓ 1248 lines elided ↑ open up ↑
1287 1285          /*
1288 1286           * See if the hash table has not yet been created; if so,
1289 1287           * we create the table and store its address atomically.
1290 1288           */
1291 1289          if ((tbl = *tbl_p) == NULL) {
1292 1290                  tbl = kmem_cache_alloc(pattbl_cache, kmflags);
1293 1291                  if (tbl == NULL)
1294 1292                          return (NULL);
1295 1293  
1296 1294                  /* if someone got there first, use his table instead */
1297      -                if ((o_tbl = casptr(tbl_p, NULL, tbl)) != NULL) {
     1295 +                if ((o_tbl = atomic_cas_ptr(tbl_p, NULL, tbl)) != NULL) {
1298 1296                          kmem_cache_free(pattbl_cache, tbl);
1299 1297                          tbl = o_tbl;
1300 1298                  }
1301 1299          }
1302 1300  
1303 1301          ASSERT(tbl->pbkt_tbl_sz > 0);
1304 1302          bkt = &(tbl[PATTBL_HASH(pai->type, tbl->pbkt_tbl_sz)]);
1305 1303  
1306 1304          /* attribute of the same type already exists? */
1307 1305          if ((pa = mmd_find_pattr(bkt, pai->type)) != NULL)
↓ open down ↓ 298 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX