misc.c 620 B

1234567891011121314151617181920212223242526
  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. ret = amd_pci_get_num_boost_states(active, states);
  15. if (ret)
  16. return ret;
  17. } else if (cpupower_cpu_info.caps & CPUPOWER_CAP_INTEL_IDA)
  18. *support = *active = 1;
  19. return 0;
  20. }
  21. #endif /* #if defined(__i386__) || defined(__x86_64__) */