cpupower.h 697 B

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