mirror of
https://github.com/anrieff/libcpuid
synced 2024-11-10 22:59:13 +00:00
Added support for reading the max multiplier
git-svn-id: https://svn.code.sf.net/p/libcpuid/code/HEAD/libcpuid@74 3b4be424-7ac5-41d7-8526-f4ddcb85d872
This commit is contained in:
parent
277eb73da7
commit
b0092bd84e
2 changed files with 8 additions and 2 deletions
|
@ -411,7 +411,8 @@ static void print_info(output_data_switch query, struct cpu_raw_data_t* raw,
|
|||
} else {
|
||||
fprintf(fout, "mperf = %d\n", cpu_msrinfo(handle, INFO_MPERF));
|
||||
fprintf(fout, "aperf = %d\n", cpu_msrinfo(handle, INFO_APERF));
|
||||
fprintf(fout, "cpu:fsb = %.1f\n", cpu_msrinfo(handle, INFO_CUR_MULTIPLIER) / 100.0f);
|
||||
fprintf(fout, "current cpu:fsb = %.1f\n", cpu_msrinfo(handle, INFO_CUR_MULTIPLIER) / 100.0f);
|
||||
fprintf(fout, "max cpu:fsb = %.1f\n", cpu_msrinfo(handle, INFO_MAX_MULTIPLIER) / 100.0f);
|
||||
cpu_msr_driver_close(handle);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -389,9 +389,14 @@ int cpu_msrinfo(struct msr_driver_t* handle, cpu_msrinfo_request_t which)
|
|||
{
|
||||
err = cpu_rdmsr(handle, 0x2a, &r);
|
||||
if (err) return CPU_INVALID_VALUE;
|
||||
return (int) ((r >> 22) & 0x3f) * 100;
|
||||
return (int) ((r>>22) & 0x1f) * 100;
|
||||
}
|
||||
case INFO_MAX_MULTIPLIER:
|
||||
{
|
||||
err = cpu_rdmsr(handle, 0x198, &r);
|
||||
if (err) return CPU_INVALID_VALUE;
|
||||
return (int) ((r >> 40) & 0x1f) * 100;
|
||||
}
|
||||
case INFO_TEMPERATURE:
|
||||
case INFO_THROTTLING:
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue