blob: f6e490312e4d23b297cb8449ac478a23c3776ac9 [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
15struct sched_domain;
Juri Lelli4ca4f262017-05-31 17:59:31 +010016unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu);
Juri Lelli615ffd62017-05-31 17:59:30 +010017
Juri Lelli4ca4f262017-05-31 17:59:31 +010018void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity);
Juri Lelli615ffd62017-05-31 17:59:30 +010019
Dietmar Eggemann0e27c562017-09-26 17:41:10 +010020DECLARE_PER_CPU(unsigned long, freq_scale);
21
22static inline
23unsigned long topology_get_freq_scale(struct sched_domain *sd, int cpu)
24{
25 return per_cpu(freq_scale, cpu);
26}
27
Juri Lelli615ffd62017-05-31 17:59:30 +010028#endif /* _LINUX_ARCH_TOPOLOGY_H_ */