misc.c 788 B

12345678910111213141516171819202122232425262728293031323334
  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, int * states)
  4. {
  5. struct cpupower_cpu_info cpu_info;
  6. int ret;
  7. *support = *active = *states = 0;
  8. ret = get_cpu_info(0, &cpu_info);
  9. if (ret)
  10. return ret;
  11. if (cpupower_cpu_info.caps & CPUPOWER_CAP_AMD_CBP) {
  12. *support = 1;
  13. amd_pci_get_num_boost_states(active, states);
  14. if (ret <= 0)
  15. return ret;
  16. *support = 1;
  17. } else if (cpupower_cpu_info.vendor == X86_VENDOR_INTEL) {
  18. ret = msr_intel_has_boost_support(cpu);
  19. if (ret <= 0)
  20. return ret;
  21. *support = ret;
  22. ret = msr_intel_boost_is_active(cpu);
  23. if (ret <= 0)
  24. return ret;
  25. *active = ret;
  26. }
  27. return 0;
  28. }
  29. #endif /* #if defined(__i386__) || defined(__x86_64__) */