• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef __CPUPOWER_CPUPOWER_H__
2 #define __CPUPOWER_CPUPOWER_H__
3 
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 
10 	/* Array gets mallocated with cores entries, holding per core info */
11 	struct cpuid_core_info *core_info;
12 };
13 
14 struct cpuid_core_info {
15 	int pkg;
16 	int core;
17 	int cpu;
18 
19 	/* flags */
20 	unsigned int is_online:1;
21 };
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 int get_cpu_topology(struct cpupower_topology *cpu_top);
28 void cpu_topology_release(struct cpupower_topology cpu_top);
29 int cpupower_is_cpu_online(unsigned int cpu);
30 
31 #ifdef __cplusplus
32 }
33 #endif
34 
35 #endif
36