Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | #ifndef _ASM_S390_TOPOLOGY_H |
2 | #define _ASM_S390_TOPOLOGY_H | |
3 | ||
dbd70fb4 HC |
4 | #include <linux/cpumask.h> |
5 | ||
78609132 | 6 | struct sysinfo_15_1_x; |
83a24e32 HC |
7 | struct cpu; |
8 | ||
9 | #ifdef CONFIG_SCHED_BOOK | |
10 | ||
d1e57508 HC |
11 | struct cpu_topology_s390 { |
12 | unsigned short core_id; | |
13 | unsigned short socket_id; | |
14 | unsigned short book_id; | |
15 | cpumask_t core_mask; | |
16 | cpumask_t book_mask; | |
17 | }; | |
18 | ||
19 | extern struct cpu_topology_s390 cpu_topology[NR_CPUS]; | |
20 | ||
21 | #define topology_physical_package_id(cpu) (cpu_topology[cpu].socket_id) | |
22 | #define topology_core_id(cpu) (cpu_topology[cpu].core_id) | |
23 | #define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_mask) | |
24 | #define topology_book_id(cpu) (cpu_topology[cpu].book_id) | |
25 | #define topology_book_cpumask(cpu) (&cpu_topology[cpu].book_mask) | |
658e5ce7 | 26 | |
d1e57508 | 27 | #define mc_capable() 1 |
d00aa4e7 | 28 | |
ac5fa22f | 29 | static inline const struct cpumask *cpu_coregroup_mask(int cpu) |
4cb14bc8 | 30 | { |
d1e57508 | 31 | return &cpu_topology[cpu].core_mask; |
4cb14bc8 HC |
32 | } |
33 | ||
ac5fa22f | 34 | static inline const struct cpumask *cpu_book_mask(int cpu) |
4cb14bc8 | 35 | { |
d1e57508 | 36 | return &cpu_topology[cpu].book_mask; |
4cb14bc8 HC |
37 | } |
38 | ||
83a24e32 | 39 | int topology_cpu_init(struct cpu *); |
c10fde0d HC |
40 | int topology_set_cpu_management(int fc); |
41 | void topology_schedule_update(void); | |
96f4a70d | 42 | void store_topology(struct sysinfo_15_1_x *info); |
d68bddb7 | 43 | void topology_expect_change(void); |
c10fde0d | 44 | |
83a24e32 HC |
45 | #else /* CONFIG_SCHED_BOOK */ |
46 | ||
47 | static inline void topology_schedule_update(void) { } | |
48 | static inline int topology_cpu_init(struct cpu *cpu) { return 0; } | |
d68bddb7 | 49 | static inline void topology_expect_change(void) { } |
83a24e32 HC |
50 | |
51 | #endif /* CONFIG_SCHED_BOOK */ | |
52 | ||
53 | #define POLARIZATION_UNKNOWN (-1) | |
c10fde0d HC |
54 | #define POLARIZATION_HRZ (0) |
55 | #define POLARIZATION_VL (1) | |
56 | #define POLARIZATION_VM (2) | |
57 | #define POLARIZATION_VH (3) | |
58 | ||
83a24e32 | 59 | #ifdef CONFIG_SCHED_BOOK |
dbd70fb4 HC |
60 | void s390_init_cpu_topology(void); |
61 | #else | |
62 | static inline void s390_init_cpu_topology(void) | |
63 | { | |
64 | }; | |
65 | #endif | |
66 | ||
1da177e4 LT |
67 | #include <asm-generic/topology.h> |
68 | ||
69 | #endif /* _ASM_S390_TOPOLOGY_H */ |