#include <cpufreq_interface.h>
Inheritance diagram for CPUFreq_Userspace:
Public Member Functions | |
CPUFreq_Userspace (std::list< int > cpu_cores) | |
constructor | |
~CPUFreq_Userspace () | |
destructor | |
bool | init () |
init cpufreq interface and set userspace governor | |
Private Member Functions | |
bool | getMinMaxSpeeds (unsigned long *min, unsigned long *max) |
get the minimum and maximum available speeds | |
unsigned | getSpeed () |
get the current CPU speed | |
int | increaseSpeed () |
set speed to the next higher supported value | |
int | decreaseSpeed () |
set speed to the next lower supported value | |
bool | setSpeed (unsigned kHz) |
set the current CPU speed | |
void | setSpeed (unsigned current, unsigned target) |
set the speed smoothly in steps | |
void | createHysteresisArray () |
creates the hysteresis array | |
bool | readFrequencies () |
reads out frequencies | |
int | adjustSpeed () |
adjusts speeds | |
void | reinitSpeed () |
reinits speeds | |
int | initFreqsViaFile () |
inits the available speeds via reading from file | |
int | initFreqsViaTesting () |
inits the available speeds via testing | |
void | setConfig () |
set configuration in initialize values | |
Private Attributes | |
string | CURRENT_SPEED_FILE |
speed file to get or set current speed | |
unsigned | _speeds_kHz [MAX_SPEEDS+1] |
array containing available speeds | |
unsigned | _demotion [MAX_SPEEDS+1] |
demotion | |
unsigned | _current_speed |
the current set speed | |
unsigned | _new_speed |
the new speed requested to set | |
unsigned | _last_step |
the last step set | |
int | _last_cpu_load |
set last cpu load | |
string | USERSPACE_STRING |
name of userspace governor to write to governor file |
|
constructor
|
|
destructor
|
|
adjusts speeds
Implements CPUFreq_Interface. |
|
creates the hysteresis array
|
|
set speed to the next lower supported value
|
|
get the minimum and maximum available speeds This is currently only used by the userspace class to test frequencies if available_frequencies file is not exported by the kernel's low-level driver
|
|
get the current CPU speed
|
|
set speed to the next higher supported value
|
|
init cpufreq interface and set userspace governor
Implements CPUFreq_Interface. |
|
inits the available speeds via reading from file
|
|
inits the available speeds via testing
|
|
reads out frequencies
Implements CPUFreq_Interface. |
|
reinits speeds function for suspend workaround. after resuming the frequency might have changed and we haven't recognized. This could possibly break old PowerNow! machines, but as far as I know jumping more than one frequency at once is fixed in kernel module for that machines Implements CPUFreq_Interface. |
|
set configuration in initialize values
Implements CPUFreq_Interface. |
|
set the speed smoothly in steps This code smoothly transitions the CPU speed from 'current' to 'target' instead of jumping directly to the new speed because some AMD Mobile Athlon parts seem to choke on large differentials causing kernel panics.
|
|
set the current CPU speed
|
|
the current set speed
|
|
demotion
|
|
set last cpu load
|
|
the last step set
|
|
the new speed requested to set
|
|
array containing available speeds
|
|
speed file to get or set current speed
|
|
name of userspace governor to write to governor file
|