cpupowerutils: helpers - ConfigStyle bugfixes
[linux-2.6.git] / tools / power / cpupower / utils / helpers / misc.c
1 #if defined(__i386__) || defined(__x86_64__)
2
3 #include "helpers/helpers.h"
4
5 int cpufreq_has_boost_support(unsigned int cpu, int *support, int *active,
6                         int *states)
7 {
8         struct cpupower_cpu_info cpu_info;
9         int ret;
10
11         *support = *active = *states = 0;
12
13         ret = get_cpu_info(0, &cpu_info);
14         if (ret)
15                 return ret;
16
17         if (cpupower_cpu_info.caps & CPUPOWER_CAP_AMD_CBP) {
18                 *support = 1;
19                 amd_pci_get_num_boost_states(active, states);
20                 if (ret <= 0)
21                         return ret;
22                 *support = 1;
23         } else if (cpupower_cpu_info.vendor == X86_VENDOR_INTEL) {
24                 ret = msr_intel_has_boost_support(cpu);
25                 if (ret <= 0)
26                         return ret;
27                 *support = ret;
28                 ret = msr_intel_boost_is_active(cpu);
29                 if (ret <= 0)
30                         return ret;
31                 *active = ret;
32         }
33         return 0;
34 }
35 #endif /* #if defined(__i386__) || defined(__x86_64__) */