blob: 56af53093d24d3660ed1267e229eccb6925b56ef [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _ASM_S390_TOPOLOGY_H
2#define _ASM_S390_TOPOLOGY_H
3
Heiko Carstensdbd70fb2008-04-17 07:46:12 +02004#include <linux/cpumask.h>
5
Heiko Carstens78609132012-09-03 14:11:32 +02006struct sysinfo_15_1_x;
Heiko Carstens83a24e32011-12-27 11:27:09 +01007struct cpu;
8
9#ifdef CONFIG_SCHED_BOOK
10
Heiko Carstensd1e575082012-11-12 10:03:25 +010011struct 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};
Heiko Carstens658e5ce2012-11-10 11:04:27 +010018
Heiko Carstensd1e575082012-11-12 10:03:25 +010019extern 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)
26
27#define mc_capable() 1
Heiko Carstensd00aa4e2008-04-30 13:38:40 +020028
Heiko Carstens83a24e32011-12-27 11:27:09 +010029int topology_cpu_init(struct cpu *);
Heiko Carstensc10fde02008-04-17 07:46:13 +020030int topology_set_cpu_management(int fc);
31void topology_schedule_update(void);
Heiko Carstens96f4a702010-10-25 16:10:54 +020032void store_topology(struct sysinfo_15_1_x *info);
Heiko Carstensd68bddb2011-12-27 11:27:16 +010033void topology_expect_change(void);
Vincent Guittot2dfd7472014-04-11 11:44:38 +020034const struct cpumask *cpu_coregroup_mask(int cpu);
Heiko Carstensc10fde02008-04-17 07:46:13 +020035
Heiko Carstens83a24e32011-12-27 11:27:09 +010036#else /* CONFIG_SCHED_BOOK */
37
38static inline void topology_schedule_update(void) { }
39static inline int topology_cpu_init(struct cpu *cpu) { return 0; }
Heiko Carstensd68bddb2011-12-27 11:27:16 +010040static inline void topology_expect_change(void) { }
Heiko Carstens83a24e32011-12-27 11:27:09 +010041
42#endif /* CONFIG_SCHED_BOOK */
43
44#define POLARIZATION_UNKNOWN (-1)
Heiko Carstensc10fde02008-04-17 07:46:13 +020045#define POLARIZATION_HRZ (0)
46#define POLARIZATION_VL (1)
47#define POLARIZATION_VM (2)
48#define POLARIZATION_VH (3)
49
Heiko Carstens83a24e32011-12-27 11:27:09 +010050#ifdef CONFIG_SCHED_BOOK
Heiko Carstensdbd70fb2008-04-17 07:46:12 +020051void s390_init_cpu_topology(void);
52#else
53static inline void s390_init_cpu_topology(void)
54{
55};
56#endif
57
Linus Torvalds1da177e2005-04-16 15:20:36 -070058#include <asm-generic/topology.h>
59
60#endif /* _ASM_S390_TOPOLOGY_H */