misc.c 635 B

12345678910111213141516171819202122232425262728
  1. #if defined(__i386__) || defined(__x86_64__)
  2. #include "helpers/helpers.h"
  3. int cpufreq_has_boost_support(unsigned int cpu, int *support, int *active,
  4. int *states)
  5. {
  6. struct cpupower_cpu_info cpu_info;
  7. int ret;
  8. *support = *active = *states = 0;
  9. ret = get_cpu_info(0, &cpu_info);
  10. if (ret)
  11. return ret;
  12. if (cpupower_cpu_info.caps & CPUPOWER_CAP_AMD_CBP) {
  13. *support = 1;
  14. amd_pci_get_num_boost_states(active, states);
  15. if (ret <= 0)
  16. return ret;
  17. *support = 1;
  18. } else if (cpupower_cpu_info.caps & CPUPOWER_CAP_INTEL_IDA)
  19. *support = *active = 1;
  20. return 0;
  21. }
  22. #endif /* #if defined(__i386__) || defined(__x86_64__) */