Print this page
5042 stop using deprecated atomic functions

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sun4u/cpu/us3_common.c
          +++ new/usr/src/uts/sun4u/cpu/us3_common.c
↓ open down ↓ 890 lines elided ↑ open up ↑
 891  891  mondo_recover(uint16_t cpuid, int bn)
 892  892  {
 893  893          struct memseg *seg;
 894  894          uint64_t begin_pa, end_pa, cur_pa;
 895  895          hrtime_t begin_hrt, end_hrt;
 896  896          int retval = 0;
 897  897          int pages_claimed = 0;
 898  898          cheetah_livelock_entry_t *histp;
 899  899          uint64_t idsr;
 900  900  
 901      -        if (cas32(&sendmondo_in_recover, 0, 1) != 0) {
      901 +        if (atomic_cas_32(&sendmondo_in_recover, 0, 1) != 0) {
 902  902                  /*
 903  903                   * Wait while recovery takes place
 904  904                   */
 905  905                  while (sendmondo_in_recover) {
 906  906                          drv_usecwait(1);
 907  907                  }
 908  908                  /*
 909  909                   * Assume we didn't claim the whole memory. If
 910  910                   * the target of this caller is not recovered,
 911  911                   * it will come back.
↓ open down ↓ 65 lines elided ↑ open up ↑
 977  977          /*
 978  978           * Update statistics
 979  979           */
 980  980          end_hrt = gethrtime_waitfree();
 981  981          CHEETAH_LIVELOCK_STAT(recovery);
 982  982          CHEETAH_LIVELOCK_MAXSTAT(hrt, (end_hrt - begin_hrt));
 983  983          CHEETAH_LIVELOCK_MAXSTAT(full_claimed, pages_claimed);
 984  984          CHEETAH_LIVELOCK_ENTRY_SET(histp, recovery_time, \
 985  985              (end_hrt -  begin_hrt));
 986  986  
 987      -        while (cas32(&sendmondo_in_recover, 1, 0) != 1)
      987 +        while (atomic_cas_32(&sendmondo_in_recover, 1, 0) != 1)
 988  988                  ;
 989  989  
 990  990          return (retval);
 991  991  }
 992  992  
 993  993  /*
 994  994   * This is called by the cyclic framework when this CPU becomes online
 995  995   */
 996  996  /*ARGSUSED*/
 997  997  static void
↓ open down ↓ 5295 lines elided ↑ open up ↑
6293 6293   */
6294 6294  static int
6295 6295  cpu_ce_delayed_ec_logout(uint64_t afar)
6296 6296  {
6297 6297          ch_cpu_logout_t *clop;
6298 6298  
6299 6299          if (CPU_PRIVATE(CPU) == NULL)
6300 6300                  return (0);
6301 6301  
6302 6302          clop = CPU_PRIVATE_PTR(CPU, chpr_cecc_logout);
6303      -        if (cas64(&clop->clo_data.chd_afar, LOGOUT_INVALID, afar) !=
     6303 +        if (atomic_cas_64(&clop->clo_data.chd_afar, LOGOUT_INVALID, afar) !=
6304 6304              LOGOUT_INVALID)
6305 6305                  return (0);
6306 6306  
6307 6307          cpu_delayed_logout(afar, clop);
6308 6308          return (1);
6309 6309  }
6310 6310  
6311 6311  /*
6312 6312   * We got an error while CEEN was disabled. We
6313 6313   * need to clean up after it and log whatever
↓ open down ↓ 983 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX