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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/vm/hat_i86.h
          +++ new/usr/src/uts/i86pc/vm/hat_i86.h
↓ open down ↓ 90 lines elided ↑ open up ↑
  91   91          htable_t        **hat_ht_hash;  /* htable hash buckets */
  92   92          htable_t        *hat_ht_cached; /* cached free htables */
  93   93          x86pte_t        hat_vlp_ptes[VLP_NUM_PTES];
  94   94  #if defined(__amd64) && defined(__xpv)
  95   95          pfn_t           hat_user_ptable; /* alt top ptable for user mode */
  96   96  #endif
  97   97  };
  98   98  typedef struct hat hat_t;
  99   99  
 100  100  #define PGCNT_INC(hat, level)   \
 101      -        atomic_add_long(&(hat)->hat_pages_mapped[level], 1);
      101 +        atomic_inc_ulong(&(hat)->hat_pages_mapped[level]);
 102  102  #define PGCNT_DEC(hat, level)   \
 103      -        atomic_add_long(&(hat)->hat_pages_mapped[level], -1);
      103 +        atomic_dec_ulong(&(hat)->hat_pages_mapped[level]);
 104  104  
 105  105  /*
 106  106   * Flags for the hat_flags field
 107  107   *
 108  108   * HAT_FREEING - set when HAT is being destroyed - mostly used to detect that
 109  109   *      demap()s can be avoided.
 110  110   *
 111  111   * HAT_VLP - indicates a 32 bit process has a virtual address range less than
 112  112   *      the hardware's physical address range. (VLP->Virtual Less-than Physical)
 113  113   *      Note - never used on the hypervisor.
↓ open down ↓ 166 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX