cpupower.h 736 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __CPUPOWER_CPUPOWER_H__
  3. #define __CPUPOWER_CPUPOWER_H__
  4. struct cpupower_topology {
  5. /* Amount of CPU cores, packages and threads per core in the system */
  6. unsigned int cores;
  7. unsigned int pkgs;
  8. unsigned int threads; /* per core */
  9. /* Array gets mallocated with cores entries, holding per core info */
  10. struct cpuid_core_info *core_info;
  11. };
  12. struct cpuid_core_info {
  13. int pkg;
  14. int core;
  15. int cpu;
  16. /* flags */
  17. unsigned int is_online:1;
  18. };
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. int get_cpu_topology(struct cpupower_topology *cpu_top);
  23. void cpu_topology_release(struct cpupower_topology cpu_top);
  24. int cpupower_is_cpu_online(unsigned int cpu);
  25. #ifdef __cplusplus
  26. }
  27. #endif
  28. #endif