aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/topology.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/include/asm/topology.h')
-rw-r--r--arch/s390/include/asm/topology.h38
1 files changed, 32 insertions, 6 deletions
diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h
index 005d77d8ae2..7016dd7b6bc 100644
--- a/arch/s390/include/asm/topology.h
+++ b/arch/s390/include/asm/topology.h
@@ -4,6 +4,10 @@
4#include <linux/cpumask.h> 4#include <linux/cpumask.h>
5#include <asm/sysinfo.h> 5#include <asm/sysinfo.h>
6 6
7struct cpu;
8
9#ifdef CONFIG_SCHED_BOOK
10
7extern unsigned char cpu_core_id[NR_CPUS]; 11extern unsigned char cpu_core_id[NR_CPUS];
8extern cpumask_t cpu_core_map[NR_CPUS]; 12extern cpumask_t cpu_core_map[NR_CPUS];
9 13
@@ -16,8 +20,6 @@ static inline const struct cpumask *cpu_coregroup_mask(int cpu)
16#define topology_core_cpumask(cpu) (&cpu_core_map[cpu]) 20#define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
17#define mc_capable() (1) 21#define mc_capable() (1)
18 22
19#ifdef CONFIG_SCHED_BOOK
20
21extern unsigned char cpu_book_id[NR_CPUS]; 23extern unsigned char cpu_book_id[NR_CPUS];
22extern cpumask_t cpu_book_map[NR_CPUS]; 24extern cpumask_t cpu_book_map[NR_CPUS];
23 25
@@ -29,19 +31,43 @@ static inline const struct cpumask *cpu_book_mask(int cpu)
29#define topology_book_id(cpu) (cpu_book_id[cpu]) 31#define topology_book_id(cpu) (cpu_book_id[cpu])
30#define topology_book_cpumask(cpu) (&cpu_book_map[cpu]) 32#define topology_book_cpumask(cpu) (&cpu_book_map[cpu])
31 33
32#endif /* CONFIG_SCHED_BOOK */ 34int topology_cpu_init(struct cpu *);
33
34int topology_set_cpu_management(int fc); 35int topology_set_cpu_management(int fc);
35void topology_schedule_update(void); 36void topology_schedule_update(void);
36void store_topology(struct sysinfo_15_1_x *info); 37void store_topology(struct sysinfo_15_1_x *info);
37 38
38#define POLARIZATION_UNKNWN (-1) 39#else /* CONFIG_SCHED_BOOK */
40
41static inline void topology_schedule_update(void) { }
42static inline int topology_cpu_init(struct cpu *cpu) { return 0; }
43
44#endif /* CONFIG_SCHED_BOOK */
45
46#define POLARIZATION_UNKNOWN (-1)
39#define POLARIZATION_HRZ (0) 47#define POLARIZATION_HRZ (0)
40#define POLARIZATION_VL (1) 48#define POLARIZATION_VL (1)
41#define POLARIZATION_VM (2) 49#define POLARIZATION_VM (2)
42#define POLARIZATION_VH (3) 50#define POLARIZATION_VH (3)
43 51
44#ifdef CONFIG_SMP 52extern int cpu_polarization[];
53
54static inline void cpu_set_polarization(int cpu, int val)
55{
56#ifdef CONFIG_SCHED_BOOK
57 cpu_polarization[cpu] = val;
58#endif
59}
60
61static inline int cpu_read_polarization(int cpu)
62{
63#ifdef CONFIG_SCHED_BOOK
64 return cpu_polarization[cpu];
65#else
66 return POLARIZATION_HRZ;
67#endif
68}
69
70#ifdef CONFIG_SCHED_BOOK
45void s390_init_cpu_topology(void); 71void s390_init_cpu_topology(void);
46#else 72#else
47static inline void s390_init_cpu_topology(void) 73static inline void s390_init_cpu_topology(void)