summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_cpu.c
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2005-02-13 18:49:48 +0000
committernjl <njl@FreeBSD.org>2005-02-13 18:49:48 +0000
commitdb1d2335dc7a9b2d42bf4e84fe48b7eb13d1b5ca (patch)
tree1b9c80a4269b3ad8984bac6e8f81b0584a66b691 /sys/kern/kern_cpu.c
parentb08240453920c3b01dccdfdcaf4ead51c8751139 (diff)
downloadFreeBSD-src-db1d2335dc7a9b2d42bf4e84fe48b7eb13d1b5ca.zip
FreeBSD-src-db1d2335dc7a9b2d42bf4e84fe48b7eb13d1b5ca.tar.gz
Add support for the CPUFREQ_FLAG_INFO_ONLY flag. Devices that report this
are not added to the list(s) of available settings. However, other drivers can call the CPUFREQ_DRV_SETTINGS() method on those devices directly to get info about available settings. Update the acpi_perf(4) driver to use this flag in the presence of "functional fixed hardware." Thus, future drivers like Powernow can query acpi_perf for platform info but perform frequency transitions themselves.
Diffstat (limited to 'sys/kern/kern_cpu.c')
-rw-r--r--sys/kern/kern_cpu.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/kern_cpu.c b/sys/kern/kern_cpu.c
index c058ead..ff1d006 100644
--- a/sys/kern/kern_cpu.c
+++ b/sys/kern/kern_cpu.c
@@ -348,13 +348,20 @@ cf_levels_method(device_t dev, struct cf_level *levels, int *count)
/* Get settings from all cpufreq drivers. */
for (i = 0; i < numdevs; i++) {
+ /* Skip devices that aren't ready. */
if (!device_is_attached(devs[i]))
continue;
+
+ /*
+ * Get settings, skipping drivers that offer no settings or
+ * provide settings for informational purposes only.
+ */
set_count = MAX_SETTINGS;
error = CPUFREQ_DRV_SETTINGS(devs[i], sets, &set_count, &type);
- if (error || set_count == 0)
+ if (error || set_count == 0 || (type & CPUFREQ_FLAG_INFO_ONLY))
continue;
+ /* Add the settings to our absolute/relative lists. */
switch (type & CPUFREQ_TYPE_MASK) {
case CPUFREQ_TYPE_ABSOLUTE:
error = cpufreq_insert_abs(sc, sets, set_count);
OpenPOWER on IntegriCloud