On 5/17/2011 6:52 AM, John Mathew wrote:
> Currently only NHM architecture cpu model numbers are checked to
> identify Intel cpus. This patch adds the Medfield model id to
> this list. Medfield is based on Atom architecture. In Atom architecture
> only the MSR_PKG_RESIDENCY registers need to be read and there is no
> MSR_CORE_RESIDENCY or MSR_CPU_RESIDENCY registers. So only a new
> nhm_package class needs to be created.
> diff --git a/cpu/intel_cpus.cpp b/cpu/intel_cpus.cpp
> index f42f3b4..db5afb2 100644
> --- a/cpu/intel_cpus.cpp
> +++ b/cpu/intel_cpus.cpp
> @@ -60,6 +60,16 @@ static uint64_t get_msr(int cpu, uint64_t offset)
> char msr_path[256];
>
> fd = sprintf(msr_path, "/dev/cpu/%d/msr", cpu);
> +
> + if (access(msr_path, R_OK) != 0){
> + fd = sprintf(msr_path, "/dev/msr%d", cpu);
> +
> + if (access(msr_path, R_OK) != 0){
> + fprintf(stderr, "msr reg not found");
> + exit(-2);
> + }
> + }
> +
> fd = open(msr_path, O_RDONLY);
>
> retval = pread(fd,&msr, sizeof msr, offset);
hmm your description does not match your patch...
missend ?
_______________________________________________
Power mailing list
[email protected]
https://bughost.org/mailman/listinfo/power