Chris Redpath | 04b61628 | 2017-12-16 14:32:21 +0000 | [diff] [blame] | 1 | #ifndef _LINUX_SCHED_ENERGY_H |
| 2 | #define _LINUX_SCHED_ENERGY_H |
| 3 | |
| 4 | #include <linux/sched.h> |
| 5 | #include <linux/slab.h> |
| 6 | |
| 7 | /* |
| 8 | * There doesn't seem to be an NR_CPUS style max number of sched domain |
| 9 | * levels so here's an arbitrary constant one for the moment. |
| 10 | * |
| 11 | * The levels alluded to here correspond to entries in struct |
| 12 | * sched_domain_topology_level that are meant to be populated by arch |
| 13 | * specific code (topology.c). |
| 14 | */ |
| 15 | #define NR_SD_LEVELS 8 |
| 16 | |
| 17 | #define SD_LEVEL0 0 |
| 18 | #define SD_LEVEL1 1 |
| 19 | #define SD_LEVEL2 2 |
| 20 | #define SD_LEVEL3 3 |
| 21 | #define SD_LEVEL4 4 |
| 22 | #define SD_LEVEL5 5 |
| 23 | #define SD_LEVEL6 6 |
| 24 | #define SD_LEVEL7 7 |
| 25 | |
| 26 | /* |
| 27 | * Convenience macro for iterating through said sd levels. |
| 28 | */ |
| 29 | #define for_each_possible_sd_level(level) \ |
| 30 | for (level = 0; level < NR_SD_LEVELS; level++) |
| 31 | |
| 32 | extern struct sched_group_energy *sge_array[NR_CPUS][NR_SD_LEVELS]; |
| 33 | |
| 34 | #ifdef CONFIG_GENERIC_ARCH_TOPOLOGY |
| 35 | void init_sched_energy_costs(void); |
| 36 | int sched_energy_installed(int cpu); |
| 37 | #else |
| 38 | void init_sched_energy_costs(void) {} |
| 39 | #endif |
| 40 | |
| 41 | #endif |