mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8134119: Use new API to get cache line sizes
Using new sysconf and sysinfo API on Solaris 12, avoid using libpicl and libkstat. Reviewed-by: kvn
This commit is contained in:
parent
30ee713e36
commit
fbca99beb2
3 changed files with 140 additions and 58 deletions
|
@ -463,3 +463,37 @@ unsigned int VM_Version::calc_parallel_worker_threads() {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
int VM_Version::parse_features(const char* implementation) {
|
||||
int features = unknown_m;
|
||||
// Convert to UPPER case before compare.
|
||||
char* impl = os::strdup_check_oom(implementation);
|
||||
|
||||
for (int i = 0; impl[i] != 0; i++)
|
||||
impl[i] = (char)toupper((uint)impl[i]);
|
||||
|
||||
if (strstr(impl, "SPARC64") != NULL) {
|
||||
features |= sparc64_family_m;
|
||||
} else if (strstr(impl, "SPARC-M") != NULL) {
|
||||
// M-series SPARC is based on T-series.
|
||||
features |= (M_family_m | T_family_m);
|
||||
} else if (strstr(impl, "SPARC-T") != NULL) {
|
||||
features |= T_family_m;
|
||||
if (strstr(impl, "SPARC-T1") != NULL) {
|
||||
features |= T1_model_m;
|
||||
}
|
||||
} else {
|
||||
if (strstr(impl, "SPARC") == NULL) {
|
||||
#ifndef PRODUCT
|
||||
// kstat on Solaris 8 virtual machines (branded zones)
|
||||
// returns "(unsupported)" implementation. Solaris 8 is not
|
||||
// supported anymore, but include this check to be on the
|
||||
// safe side.
|
||||
warning("Can't parse CPU implementation = '%s', assume generic SPARC", impl);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
os::free((void*)impl);
|
||||
return features;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue