Commit | Line | Data |
---|---|---|
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 |
7 | struct cpu; |
8 | ||
9 | #ifdef CONFIG_SCHED_BOOK | |
10 | ||
10d38589 | 11 | extern unsigned char cpu_core_id[NR_CPUS]; |
d00aa4e7 HC |
12 | extern cpumask_t cpu_core_map[NR_CPUS]; |
13 | ||
ac5fa22f | 14 | static 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 |
23 | extern unsigned char cpu_book_id[NR_CPUS]; |
24 | extern cpumask_t cpu_book_map[NR_CPUS]; | |
25 | ||
ac5fa22f | 26 | static 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 | 34 | int topology_cpu_init(struct cpu *); |
c10fde0d HC |
35 | int topology_set_cpu_management(int fc); |
36 | void topology_schedule_update(void); | |
96f4a70d | 37 | void store_topology(struct sysinfo_15_1_x *info); |
c10fde0d | 38 | |
83a24e32 HC |
39 | #else /* CONFIG_SCHED_BOOK */ |
40 | ||
41 | static inline void topology_schedule_update(void) { } | |
42 | static inline int topology_cpu_init(struct cpu *cpu) { return 0; } | |
43 | ||
44 | #endif /* CONFIG_SCHED_BOOK */ | |
45 | ||
46 | #define POLARIZATION_UNKNOWN (-1) | |
c10fde0d HC |
47 | #define POLARIZATION_HRZ (0) |
48 | #define POLARIZATION_VL (1) | |
49 | #define POLARIZATION_VM (2) | |
50 | #define POLARIZATION_VH (3) | |
51 | ||
83a24e32 HC |
52 | extern int cpu_polarization[]; |
53 | ||
54 | static inline void cpu_set_polarization(int cpu, int val) | |
55 | { | |
56 | #ifdef CONFIG_SCHED_BOOK | |
57 | cpu_polarization[cpu] = val; | |
58 | #endif | |
59 | } | |
60 | ||
61 | static 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 | |
dbd70fb4 HC |
71 | void s390_init_cpu_topology(void); |
72 | #else | |
73 | static inline void s390_init_cpu_topology(void) | |
74 | { | |
75 | }; | |
76 | #endif | |
77 | ||
4cb14bc8 HC |
78 | #define SD_BOOK_INIT SD_CPU_INIT |
79 | ||
1da177e4 LT |
80 | #include <asm-generic/topology.h> |
81 | ||
82 | #endif /* _ASM_S390_TOPOLOGY_H */ |