diff options
| author | Dominik Brodowski <linux@brodo.de> | 2002-09-28 21:21:46 -0700 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@mandrakesoft.com> | 2002-09-28 21:21:46 -0700 |
| commit | a82b282f9fdcf9d12cc79c0fe5b40c3f3f75bb20 (patch) | |
| tree | 9519b5d00b3dab2aba62f085acf2e0a4aaff5116 /include/linux | |
| parent | 427f9384aed1fe01eb3e1f995e8dbf6845312aed (diff) | |
[PATCH] (5/5) CPUfreq /proc/sys/cpu/ add-on patch
CPUFreq 24-API add-on patch for 2.5.39:
kernel/cpufreq.c cpufreq-24-API
include/linux/cpufreq.h cpufreq-24-API
arch/i386/config.in Transmeta LongRun does not work well with cpufreq-24-API
arch/i386/Config.help help text for CONFIG_CPU_FREQ_24_API
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/cpufreq.h | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 8113b0a8289e..5e39e5d0453c 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -155,4 +155,98 @@ int cpufreq_restore(void); #endif +#ifdef CONFIG_CPU_FREQ_24_API +/********************************************************************* + * CPUFREQ 2.4. INTERFACE * + *********************************************************************/ +int cpufreq_setmax(unsigned int cpu); +#ifdef CONFIG_PM +int cpufreq_restore(void); +#endif +int cpufreq_set(unsigned int kHz, unsigned int cpu); +unsigned int cpufreq_get(unsigned int cpu); + +/* /proc/sys/cpu */ +enum { + CPU_NR = 1, /* compatibilty reasons */ + CPU_NR_0 = 1, + CPU_NR_1 = 2, + CPU_NR_2 = 3, + CPU_NR_3 = 4, + CPU_NR_4 = 5, + CPU_NR_5 = 6, + CPU_NR_6 = 7, + CPU_NR_7 = 8, + CPU_NR_8 = 9, + CPU_NR_9 = 10, + CPU_NR_10 = 11, + CPU_NR_11 = 12, + CPU_NR_12 = 13, + CPU_NR_13 = 14, + CPU_NR_14 = 15, + CPU_NR_15 = 16, + CPU_NR_16 = 17, + CPU_NR_17 = 18, + CPU_NR_18 = 19, + CPU_NR_19 = 20, + CPU_NR_20 = 21, + CPU_NR_21 = 22, + CPU_NR_22 = 23, + CPU_NR_23 = 24, + CPU_NR_24 = 25, + CPU_NR_25 = 26, + CPU_NR_26 = 27, + CPU_NR_27 = 28, + CPU_NR_28 = 29, + CPU_NR_29 = 30, + CPU_NR_30 = 31, + CPU_NR_31 = 32, +}; + +/* /proc/sys/cpu/{0,1,...,(NR_CPUS-1)} */ +enum { + CPU_NR_FREQ_MAX = 1, + CPU_NR_FREQ_MIN = 2, + CPU_NR_FREQ = 3, +}; + +#define CTL_CPU_VARS_SPEED_MAX { \ + ctl_name: CPU_NR_FREQ_MAX, \ + data: &cpu_max_freq, \ + procname: "speed-max", \ + maxlen: sizeof(cpu_max_freq),\ + mode: 0444, \ + proc_handler: proc_dointvec, } + +#define CTL_CPU_VARS_SPEED_MIN { \ + ctl_name: CPU_NR_FREQ_MIN, \ + data: &cpu_min_freq, \ + procname: "speed-min", \ + maxlen: sizeof(cpu_min_freq),\ + mode: 0444, \ + proc_handler: proc_dointvec, } + +#define CTL_CPU_VARS_SPEED(cpunr) { \ + ctl_name: CPU_NR_FREQ, \ + procname: "speed", \ + mode: 0644, \ + proc_handler: cpufreq_procctl, \ + strategy: cpufreq_sysctl, \ + extra1: (void*) (cpunr), } + +#define CTL_TABLE_CPU_VARS(cpunr) static ctl_table ctl_cpu_vars_##cpunr[] = {\ + CTL_CPU_VARS_SPEED_MAX, \ + CTL_CPU_VARS_SPEED_MIN, \ + CTL_CPU_VARS_SPEED(cpunr), \ + { ctl_name: 0, }, } + +/* the ctl_table entry for each CPU */ +#define CPU_ENUM(s) { \ + ctl_name: (CPU_NR + s), \ + procname: #s, \ + mode: 0555, \ + child: ctl_cpu_vars_##s } + +#endif /* CONFIG_CPU_FREQ_24_API */ + #endif /* _LINUX_CPUFREQ_H */ |
