< prev index next >

src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp

Print this page

        

*** 618,627 **** --- 618,650 ---- major,minor, result ? "DOES" : "does NOT"); return result; #endif // AMD64 } + juint os::cpu_microcode_revision() { + juint result = 0; + #if defined(IA32) || defined(AMD64) + // Other platforms have less repetitive cpuinfo files + char * line = NULL; + size_t len = 0; + ssize_t read; + FILE *fp = fopen("/proc/cpuinfo", "r"); + if (fp) { + while ((read = getline(&line, &len, fp)) != -1) { + if (len > 10 && strstr(line, "microcode") != NULL) { + char* rev = strchr(line, ':'); + if (rev != NULL) sscanf(rev + 1, "%x", &result); + break; + } + } + free(line); + fclose(fp); + } + #endif // x86 platforms + return result; + } + bool os::is_allocatable(size_t bytes) { #ifdef AMD64 // unused on amd64? return true; #else
< prev index next >