blob: c189de3ef5dfa976cf6c4bf490f86aee9956bc50 [file] [log] [blame]
Juri Lelli615ffd62017-05-31 17:59:30 +01001/*
2 * include/linux/arch_topology.h - arch specific cpu topology information
3 */
4#ifndef _LINUX_ARCH_TOPOLOGY_H_
5#define _LINUX_ARCH_TOPOLOGY_H_
6
Viresh Kumar805df292017-06-23 14:55:32 +05307#include <linux/types.h>
Dietmar Eggemann0e27c562017-09-26 17:41:10 +01008#include <linux/percpu.h>
Viresh Kumar805df292017-06-23 14:55:32 +05309
Juri Lelli4ca4f262017-05-31 17:59:31 +010010void topology_normalize_cpu_scale(void);
Juri Lelli615ffd62017-05-31 17:59:30 +010011
12struct device_node;
Viresh Kumar805df292017-06-23 14:55:32 +053013bool topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu);
Juri Lelli615ffd62017-05-31 17:59:30 +010014
Dietmar Eggemann8216f582017-09-26 17:41:11 +010015DECLARE_PER_CPU(unsigned long, cpu_scale);
16
Juri Lelli615ffd62017-05-31 17:59:30 +010017struct sched_domain;
Dietmar Eggemann8216f582017-09-26 17:41:11 +010018static inline
19unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu)
20{
21 return per_cpu(cpu_scale, cpu);
22}
Juri Lelli615ffd62017-05-31 17:59:30 +010023
Juri Lelli4ca4f262017-05-31 17:59:31 +010024void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity);
Juri Lelli615ffd62017-05-31 17:59:30 +010025
Dietmar Eggemann0e27c562017-09-26 17:41:10 +010026DECLARE_PER_CPU(unsigned long, freq_scale);
27
28static inline
29unsigned long topology_get_freq_scale(struct sched_domain *sd, int cpu)
30{
31 return per_cpu(freq_scale, cpu);
32}
33
Juri Lelli615ffd62017-05-31 17:59:30 +010034#endif /* _LINUX_ARCH_TOPOLOGY_H_ */