Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sfmmu/vm/hat_sfmmu.h
          +++ new/usr/src/uts/sfmmu/vm/hat_sfmmu.h
↓ open down ↓ 351 lines elided ↑ open up ↑
 352  352                          break;                                  \
 353  353                  }                                               \
 354  354          }                                                       \
 355  355          if (_i < SFMMU_RGNMAP_WORDS)                            \
 356  356                  rval = 0;                                       \
 357  357          else                                                    \
 358  358                  rval = 1;                                       \
 359  359  }
 360  360  
 361  361  #define SF_SCD_INCR_REF(scdp) {                                         \
 362      -        atomic_add_32((volatile uint32_t *)&(scdp)->scd_refcnt, 1);     \
      362 +        atomic_inc_32((volatile uint32_t *)&(scdp)->scd_refcnt);        \
 363  363  }
 364  364  
 365  365  #define SF_SCD_DECR_REF(srdp, scdp) {                           \
 366  366          sf_region_map_t _scd_rmap = (scdp)->scd_region_map;     \
 367      -        if (!atomic_add_32_nv(                                  \
 368      -            (volatile uint32_t *)&(scdp)->scd_refcnt, -1)) {    \
      367 +        if (!atomic_dec_32_nv((volatile uint32_t *)&(scdp)->scd_refcnt)) {\
 369  368                  sfmmu_destroy_scd((srdp), (scdp), &_scd_rmap);  \
 370  369          }                                                       \
 371  370  }
 372  371  
 373  372  /*
 374  373   * A sfmmup link in the link list of sfmmups that share the same region.
 375  374   */
 376  375  typedef struct sf_rgn_link {
 377  376          sfmmu_t *next;
 378  377          sfmmu_t *prev;
↓ open down ↓ 2211 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX