Print this page
5255 uts shouldn't open-code ISP2

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sun4v/os/fillsysinfo.c
          +++ new/usr/src/uts/sun4v/os/fillsysinfo.c
↓ open down ↓ 457 lines elided ↑ open up ↑
 458  458          /*
 459  459           * Make kpm_vbase, kpm_size aligned to kpm_size_shift.
 460  460           * To do this find the nearest power of 2 size that the
 461  461           * actual ra_limit fits within.
 462  462           * If it is an even power of two use that, otherwise use the
 463  463           * next power of two larger than ra_limit.
 464  464           */
 465  465  
 466  466          ASSERT(ra_limit != 0);
 467  467  
 468      -        kpm_size_shift = (ra_limit & (ra_limit - 1)) != 0 ?
      468 +        kpm_size_shift = !ISP2(ra_limit) ?
 469  469              highbit(ra_limit) : highbit(ra_limit) - 1;
 470  470  
 471  471          /*
 472  472           * No virtual caches on sun4v so size matches size shift
 473  473           */
 474  474          kpm_size = 1ul << kpm_size_shift;
 475  475  
 476  476          if (va_bits < VA_ADDRESS_SPACE_BITS) {
 477  477                  /*
 478  478                   * In case of VA hole
↓ open down ↓ 364 lines elided ↑ open up ↑
 843  843                  if (!broken_md_flag)
 844  844                          cmn_err(CE_PANIC, "Missing %s property in MD cpu node",
 845  845                              qnamep);
 846  846                  entries = default_entries;
 847  847          } else {
 848  848                  entries = 1 << entries;
 849  849          }
 850  850  
 851  851          entries = MIN(entries, max_entries);
 852  852          /* If not a power of 2, truncate to a power of 2. */
 853      -        if ((entries & (entries - 1)) != 0) {
      853 +        if (!ISP2(entries)) {
 854  854                  entries = 1 << (highbit(entries) - 1);
 855  855          }
 856  856  
 857  857          return (entries);
 858  858  }
 859  859  
 860  860  /* Scaling constant used to compute size of cpu mondo queue */
 861  861  #define CPU_MONDO_Q_MULTIPLIER  8
 862  862  
 863  863  static void
↓ open down ↓ 571 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX