mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 03:24:38 +02:00
8249672: Include microcode revision in features_string on x86
Reviewed-by: kvn, stuefe
This commit is contained in:
parent
006d0bcec1
commit
cd98f7d5bf
7 changed files with 54 additions and 2 deletions
|
@ -620,6 +620,26 @@ bool os::supports_sse() {
|
|||
#endif // AMD64
|
||||
}
|
||||
|
||||
juint os::cpu_microcode_revision() {
|
||||
juint result = 0;
|
||||
char data[2048] = {0}; // lines should fit in 2K buf
|
||||
size_t len = sizeof(data);
|
||||
FILE *fp = fopen("/proc/cpuinfo", "r");
|
||||
if (fp) {
|
||||
while (!feof(fp)) {
|
||||
if (fgets(data, len, fp)) {
|
||||
if (strstr(data, "microcode") != NULL) {
|
||||
char* rev = strchr(data, ':');
|
||||
if (rev != NULL) sscanf(rev + 1, "%x", &result);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool os::is_allocatable(size_t bytes) {
|
||||
#ifdef AMD64
|
||||
// unused on amd64?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue