Re: Get the min and max frequency of a processor

From: Borislav Petkov
Date: Fri Aug 31 2012 - 08:26:00 EST


On Fri, Aug 31, 2012 at 06:52:46AM -0300, Marcos Souza wrote:
> Nothing is wrong with access /sys, but I thought there was another
> way, like an API or something else.

Ah, there's no API, AFAICT.

Also, tools/power/cpupower/ uses sysfs too - you could reuse that
code if you don't feel like writing it yourself. The function is
cpufreq_get_hardware_limits()

Ok, technically, there is also a way to query the CPU's MSRs directly
but this is a bit more involved than reading sysfs nodes.

HTH.

--
Regards/Gruss,
Boris.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/