]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From: jbeulich@novell.com |
2 | Subject: make /proc/cpuinfo track CPU speed | |
3 | Patch-mainline: obsolete | |
4 | ||
5 | --- sle11-2009-07-31.orig/arch/x86/kernel/acpi/processor_extcntl_xen.c 2009-07-31 14:52:14.000000000 +0200 | |
6 | +++ sle11-2009-07-31/arch/x86/kernel/acpi/processor_extcntl_xen.c 2009-07-31 15:14:03.000000000 +0200 | |
7 | @@ -204,3 +204,14 @@ void arch_acpi_processor_init_extcntl(co | |
8 | *ops = &xen_extcntl_ops; | |
9 | } | |
10 | EXPORT_SYMBOL(arch_acpi_processor_init_extcntl); | |
11 | + | |
12 | +unsigned int cpufreq_quick_get(unsigned int cpu) | |
13 | +{ | |
14 | + xen_platform_op_t op = { | |
15 | + .cmd = XENPF_get_cpu_freq, | |
16 | + .interface_version = XENPF_INTERFACE_VERSION, | |
17 | + .u.get_cpu_freq.vcpu = cpu | |
18 | + }; | |
19 | + | |
20 | + return HYPERVISOR_platform_op(&op) == 0 ? op.u.get_cpu_freq.freq : 0; | |
21 | +} | |
22 | --- sle11-2009-07-31.orig/include/linux/cpufreq.h 2009-07-31 14:49:20.000000000 +0200 | |
23 | +++ sle11-2009-07-31/include/linux/cpufreq.h 2008-10-01 16:44:34.000000000 +0200 | |
24 | @@ -282,7 +282,7 @@ int cpufreq_update_policy(unsigned int c | |
25 | unsigned int cpufreq_get(unsigned int cpu); | |
26 | ||
27 | /* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */ | |
28 | -#ifdef CONFIG_CPU_FREQ | |
29 | +#if defined(CONFIG_CPU_FREQ) || defined(CONFIG_PROCESSOR_EXTERNAL_CONTROL) | |
30 | unsigned int cpufreq_quick_get(unsigned int cpu); | |
31 | #else | |
32 | static inline unsigned int cpufreq_quick_get(unsigned int cpu) | |
33 | --- sle11-2009-07-31.orig/include/xen/interface/platform.h 2009-07-31 14:49:20.000000000 +0200 | |
34 | +++ sle11-2009-07-31/include/xen/interface/platform.h 2008-10-01 16:44:34.000000000 +0200 | |
35 | @@ -312,6 +312,16 @@ struct xenpf_set_processor_pminfo { | |
36 | typedef struct xenpf_set_processor_pminfo xenpf_set_processor_pminfo_t; | |
37 | DEFINE_XEN_GUEST_HANDLE(xenpf_set_processor_pminfo_t); | |
38 | ||
39 | +#define XENPF_get_cpu_freq ('N' << 24) | |
40 | +struct xenpf_get_cpu_freq { | |
41 | + /* IN variables */ | |
42 | + uint32_t vcpu; | |
43 | + /* OUT variables */ | |
44 | + uint32_t freq; /* in kHz */ | |
45 | +}; | |
46 | +typedef struct xenpf_get_cpu_freq xenpf_get_cpu_freq_t; | |
47 | +DEFINE_XEN_GUEST_HANDLE(xenpf_get_cpu_freq_t); | |
48 | + | |
49 | struct xen_platform_op { | |
50 | uint32_t cmd; | |
51 | uint32_t interface_version; /* XENPF_INTERFACE_VERSION */ | |
52 | @@ -327,6 +337,7 @@ struct xen_platform_op { | |
53 | struct xenpf_change_freq change_freq; | |
54 | struct xenpf_getidletime getidletime; | |
55 | struct xenpf_set_processor_pminfo set_pminfo; | |
56 | + struct xenpf_get_cpu_freq get_cpu_freq; | |
57 | uint8_t pad[128]; | |
58 | } u; | |
59 | }; |