]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/s390/include/asm/topology.h
Merge branch 'next' into for-linus
[mirror_ubuntu-bionic-kernel.git] / arch / s390 / include / asm / topology.h
CommitLineData
1da177e4
LT
1#ifndef _ASM_S390_TOPOLOGY_H
2#define _ASM_S390_TOPOLOGY_H
3
dbd70fb4 4#include <linux/cpumask.h>
96f4a70d 5#include <asm/sysinfo.h>
dbd70fb4 6
83a24e32
HC
7struct cpu;
8
9#ifdef CONFIG_SCHED_BOOK
10
10d38589 11extern unsigned char cpu_core_id[NR_CPUS];
d00aa4e7
HC
12extern cpumask_t cpu_core_map[NR_CPUS];
13
ac5fa22f 14static inline const struct cpumask *cpu_coregroup_mask(int cpu)
4cb14bc8
HC
15{
16 return &cpu_core_map[cpu];
17}
18
10d38589 19#define topology_core_id(cpu) (cpu_core_id[cpu])
2bb23a63 20#define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
4cb14bc8
HC
21#define mc_capable() (1)
22
4cb14bc8
HC
23extern unsigned char cpu_book_id[NR_CPUS];
24extern cpumask_t cpu_book_map[NR_CPUS];
25
ac5fa22f 26static inline const struct cpumask *cpu_book_mask(int cpu)
4cb14bc8
HC
27{
28 return &cpu_book_map[cpu];
29}
30
31#define topology_book_id(cpu) (cpu_book_id[cpu])
32#define topology_book_cpumask(cpu) (&cpu_book_map[cpu])
33
83a24e32 34int topology_cpu_init(struct cpu *);
c10fde0d
HC
35int topology_set_cpu_management(int fc);
36void topology_schedule_update(void);
96f4a70d 37void store_topology(struct sysinfo_15_1_x *info);
d68bddb7 38void topology_expect_change(void);
c10fde0d 39
83a24e32
HC
40#else /* CONFIG_SCHED_BOOK */
41
42static inline void topology_schedule_update(void) { }
43static inline int topology_cpu_init(struct cpu *cpu) { return 0; }
d68bddb7 44static inline void topology_expect_change(void) { }
83a24e32
HC
45
46#endif /* CONFIG_SCHED_BOOK */
47
48#define POLARIZATION_UNKNOWN (-1)
c10fde0d
HC
49#define POLARIZATION_HRZ (0)
50#define POLARIZATION_VL (1)
51#define POLARIZATION_VM (2)
52#define POLARIZATION_VH (3)
53
83a24e32
HC
54extern int cpu_polarization[];
55
56static inline void cpu_set_polarization(int cpu, int val)
57{
58#ifdef CONFIG_SCHED_BOOK
59 cpu_polarization[cpu] = val;
60#endif
61}
62
63static inline int cpu_read_polarization(int cpu)
64{
65#ifdef CONFIG_SCHED_BOOK
66 return cpu_polarization[cpu];
67#else
68 return POLARIZATION_HRZ;
69#endif
70}
71
72#ifdef CONFIG_SCHED_BOOK
dbd70fb4
HC
73void s390_init_cpu_topology(void);
74#else
75static inline void s390_init_cpu_topology(void)
76{
77};
78#endif
79
4cb14bc8
HC
80#define SD_BOOK_INIT SD_CPU_INIT
81
1da177e4
LT
82#include <asm-generic/topology.h>
83
84#endif /* _ASM_S390_TOPOLOGY_H */