440 |
440 |
441 // If SI_CPUBRAND works, that means Solaris 12 API to get the cache line sizes |
441 // If SI_CPUBRAND works, that means Solaris 12 API to get the cache line sizes |
442 // is available to us as well |
442 // is available to us as well |
443 Sysinfo cpu_info(SI_CPUBRAND); |
443 Sysinfo cpu_info(SI_CPUBRAND); |
444 bool use_solaris_12_api = cpu_info.valid(); |
444 bool use_solaris_12_api = cpu_info.valid(); |
445 const char* impl; |
445 const char* impl = "unknown"; |
446 int impl_m = 0; |
446 int impl_m = 0; |
447 if (use_solaris_12_api) { |
447 if (use_solaris_12_api) { |
448 impl = cpu_info.value(); |
448 impl = cpu_info.value(); |
449 #ifndef PRODUCT |
449 #ifndef PRODUCT |
450 if (PrintMiscellaneous && Verbose) { |
450 if (PrintMiscellaneous && Verbose) { |
475 } |
475 } |
476 } |
476 } |
477 kstat_close(kc); |
477 kstat_close(kc); |
478 } |
478 } |
479 } |
479 } |
480 assert(impl_m != 0, err_msg("Unknown CPU implementation %s", impl)); |
480 assert(impl_m != 0, err_msg("Unrecognized CPU implementation %s", impl)); |
481 features |= impl_m; |
481 features |= impl_m; |
482 |
482 |
483 bool is_sun4v = (features & sun4v_m) != 0; |
483 bool is_sun4v = (features & sun4v_m) != 0; |
484 if (use_solaris_12_api && is_sun4v) { |
484 if (use_solaris_12_api && is_sun4v) { |
485 // If Solaris 12 API is supported and it's sun4v use sysconf() to get the cache line sizes |
485 // If Solaris 12 API is supported and it's sun4v use sysconf() to get the cache line sizes |