2017-05-31 17:59:30 +01:00
|
|
|
/*
|
|
|
|
* include/linux/arch_topology.h - arch specific cpu topology information
|
|
|
|
*/
|
|
|
|
#ifndef _LINUX_ARCH_TOPOLOGY_H_
|
|
|
|
#define _LINUX_ARCH_TOPOLOGY_H_
|
|
|
|
|
2017-06-23 14:55:32 +05:30
|
|
|
#include <linux/types.h>
|
2017-06-30 17:00:23 +01:00
|
|
|
#include <linux/percpu.h>
|
2017-06-23 14:55:32 +05:30
|
|
|
|
2017-05-31 17:59:31 +01:00
|
|
|
void topology_normalize_cpu_scale(void);
|
2017-10-19 13:46:03 +01:00
|
|
|
int topology_detect_flags(void);
|
|
|
|
int topology_smt_flags(void);
|
|
|
|
int topology_core_flags(void);
|
|
|
|
int topology_cpu_flags(void);
|
|
|
|
int topology_update_cpu_topology(void);
|
2018-08-09 13:54:59 +09:00
|
|
|
void topology_update(void);
|
2017-05-31 17:59:30 +01:00
|
|
|
|
|
|
|
struct device_node;
|
2017-06-23 14:55:32 +05:30
|
|
|
bool topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu);
|
2017-05-31 17:59:30 +01:00
|
|
|
|
2017-07-21 11:40:58 +01:00
|
|
|
DECLARE_PER_CPU(unsigned long, cpu_scale);
|
|
|
|
|
2017-05-31 17:59:30 +01:00
|
|
|
struct sched_domain;
|
2017-07-21 11:40:58 +01:00
|
|
|
static inline
|
|
|
|
unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu)
|
|
|
|
{
|
|
|
|
return per_cpu(cpu_scale, cpu);
|
|
|
|
}
|
2017-05-31 17:59:30 +01:00
|
|
|
|
2017-05-31 17:59:31 +01:00
|
|
|
void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity);
|
2017-05-31 17:59:30 +01:00
|
|
|
|
2017-06-30 17:00:23 +01:00
|
|
|
DECLARE_PER_CPU(unsigned long, freq_scale);
|
|
|
|
|
|
|
|
static inline
|
|
|
|
unsigned long topology_get_freq_scale(struct sched_domain *sd, int cpu)
|
|
|
|
{
|
|
|
|
return per_cpu(freq_scale, cpu);
|
|
|
|
}
|
|
|
|
|
2017-05-31 17:59:30 +01:00
|
|
|
#endif /* _LINUX_ARCH_TOPOLOGY_H_ */
|