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