4
* Copyright (C) 2014, Linaro Limited.
6
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; version 2 of the License.
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* General Public License for more details.
16
* You should have received a copy of the GNU General Public License along
17
* with this program; if not, write to the Free Software Foundation, Inc.,
18
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23
* Daniel Lezcano <daniel.lezcano@linaro.org>
24
* Zoran Markovic <zoran.markovic@linaro.org>
25
* Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
38
struct list_head list_cpu;
40
struct list_head list_phy_enum;
41
struct cpuidle_cstates *cstates;
42
struct cpufreq_pstates *pstates;
43
struct cpuidle_cstates *base_cstates;
44
struct cpufreq_pstates *base_pstates;
48
struct list_head list_core;
50
struct list_head cpu_head;
53
struct cpuidle_cstates *cstates;
54
struct cpufreq_pstates *pstates;
55
struct cpuidle_cstates *base_cstates;
56
struct cpufreq_pstates *base_pstates;
60
struct list_head list_physical;
62
struct list_head core_head;
64
struct list_head cpu_enum_head;
65
struct cpuidle_cstates *cstates;
66
struct cpufreq_pstates *pstates;
67
struct cpuidle_cstates *base_cstates;
68
struct cpufreq_pstates *base_pstates;
72
struct list_head physical_head;
76
extern struct cpu_topology *alloc_cpu_topo_info(void);
77
extern struct cpu_topology *read_cpu_topo_info(FILE *f, char *buf);
78
extern struct cpu_topology *read_sysfs_cpu_topo(void);
79
extern int release_cpu_topo_info(struct cpu_topology *topo);
80
extern int output_cpu_topo_info(struct cpu_topology *topo, FILE *f);
81
extern void assign_baseline_in_topo(struct cpuidle_datas *datas);
82
extern int release_cpu_topo_cstates(struct cpu_topology *topo);
83
extern int dump_cpu_topo_info(struct report_ops *ops, void *report_data, int (*dump)(struct report_ops *, void *, void *, char *, void *), struct cpu_topology *topo, int cstate);
85
extern struct cpu_physical *cpu_to_cluster(int cpuid, struct cpu_topology *topo);
86
extern struct cpu_core *cpu_to_core(int cpuid, struct cpu_topology *topo);
88
#define core_for_each_cpu(cpu, core) \
89
list_for_each_entry(cpu, &core->cpu_head, list_cpu)
91
#define cluster_for_each_core(core, clust) \
92
list_for_each_entry(core, &clust->core_head, list_core)
94
#define cluster_for_each_cpu(cpu, clust) \
95
list_for_each_entry(cpu, &clust->cpu_enum_head, list_phy_enum)
97
#define topo_for_each_cluster(clust, topo) \
98
list_for_each_entry(clust, &topo->physical_head, list_physical)
100
extern int cluster_get_least_cstate(struct cpu_physical *clust);
101
extern int cluster_get_highest_freq(struct cpu_physical *clust);
102
#define get_affected_cluster_least_cstate(cpuid, topo) \
103
cluster_get_least_cstate(cpu_to_cluster(cpuid, topo))
104
#define get_affected_cluster_highest_freq(cpuid, topo) \
105
cluster_get_highest_freq(cpu_to_cluster(cpuid, topo))
107
extern int core_get_least_cstate(struct cpu_core *core);
108
extern int core_get_highest_freq(struct cpu_core *core);
109
#define get_affected_core_least_cstate(cpuid, topo) \
110
core_get_least_cstate(cpu_to_core(cpuid, topo))
111
#define get_affected_core_highest_freq(cpuid, topo) \
112
core_get_highest_freq(cpu_to_core(cpuid, topo))
114
extern int setup_topo_states(struct cpuidle_datas *datas);