Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/cpu.h
Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | |||||
* levels of 50, 100, 150, 200, 300, 400. | * levels of 50, 100, 150, 200, 300, 400. | ||||
* | * | ||||
* The "info only" flag signifies that settings returned by | * The "info only" flag signifies that settings returned by | ||||
* CPUFREQ_DRV_SETTINGS cannot be passed to the CPUFREQ_DRV_SET method and | * CPUFREQ_DRV_SETTINGS cannot be passed to the CPUFREQ_DRV_SET method and | ||||
* are only informational. This is for some drivers that can return | * are only informational. This is for some drivers that can return | ||||
* information about settings but rely on another machine-dependent driver | * information about settings but rely on another machine-dependent driver | ||||
* for actually performing the frequency transition (e.g., ACPI performance | * for actually performing the frequency transition (e.g., ACPI performance | ||||
* states of type "functional fixed hardware.") | * states of type "functional fixed hardware.") | ||||
* | |||||
* The "uncached" flag tells CPUFREQ_DRV_GET to try obtaining the real | |||||
* instantaneous frequency from the underlying hardware regardless of cached | |||||
* state. It is probably a bug to not combine this with "info only" | |||||
jhb: This is fine as-is. I would perhaps be inclined to invert this flag's sense to assume an… | |||||
*/ | */ | ||||
#define CPUFREQ_TYPE_MASK 0xffff | #define CPUFREQ_TYPE_MASK 0xffff | ||||
#define CPUFREQ_TYPE_RELATIVE (1<<0) | #define CPUFREQ_TYPE_RELATIVE (1<<0) | ||||
#define CPUFREQ_TYPE_ABSOLUTE (1<<1) | #define CPUFREQ_TYPE_ABSOLUTE (1<<1) | ||||
#define CPUFREQ_FLAG_INFO_ONLY (1<<16) | #define CPUFREQ_FLAG_INFO_ONLY (1<<16) | ||||
#define CPUFREQ_FLAG_UNCACHED (1<<17) | |||||
/* | /* | ||||
* When setting a level, the caller indicates the priority of this request. | * When setting a level, the caller indicates the priority of this request. | ||||
* Priorities determine, among other things, whether a level can be | * Priorities determine, among other things, whether a level can be | ||||
* overridden by other callers. For example, if the user sets a level but | * overridden by other callers. For example, if the user sets a level but | ||||
* the system thermal driver needs to override it for emergency cooling, | * the system thermal driver needs to override it for emergency cooling, | ||||
* the driver would use a higher priority. Once the event has passed, the | * the driver would use a higher priority. Once the event has passed, the | ||||
* driver would call cpufreq to resume any previous level. | * driver would call cpufreq to resume any previous level. | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |
This is fine as-is. I would perhaps be inclined to invert this flag's sense to assume an actual "real" get method by default and falling back to using the previously set level on "dumb" drivers, something like 'CPUFREQ_FLAG_SETONLY' maybe. I don't think it's worth changing right now though.