blob: 9935cbd6a46fdee89e8cdfd65c7f9acc0de474b9 [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 Carstens658e5ce2012-11-10 11:04:27 +010011extern unsigned char cpu_socket_id[NR_CPUS];
12#define topology_physical_package_id(cpu) (cpu_socket_id[cpu])
13
Heiko Carstens10d38582010-05-17 10:00:12 +020014extern unsigned char cpu_core_id[NR_CPUS];
Heiko Carstensd00aa4e2008-04-30 13:38:40 +020015extern cpumask_t cpu_core_map[NR_CPUS];
16
Heiko Carstensac5fa222011-05-26 09:48:27 +020017static inline const struct cpumask *cpu_coregroup_mask(int cpu)
Heiko Carstens4cb14bc2010-08-31 10:28:18 +020018{
19 return &cpu_core_map[cpu];
20}
21
Heiko Carstens10d38582010-05-17 10:00:12 +020022#define topology_core_id(cpu) (cpu_core_id[cpu])
Rusty Russell2bb23a62009-01-01 10:12:20 +103023#define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
Heiko Carstens4cb14bc2010-08-31 10:28:18 +020024#define mc_capable() (1)
25
Heiko Carstens4cb14bc2010-08-31 10:28:18 +020026extern unsigned char cpu_book_id[NR_CPUS];
27extern cpumask_t cpu_book_map[NR_CPUS];
28
Heiko Carstensac5fa222011-05-26 09:48:27 +020029static inline const struct cpumask *cpu_book_mask(int cpu)
Heiko Carstens4cb14bc2010-08-31 10:28:18 +020030{
31 return &cpu_book_map[cpu];
32}
33
34#define topology_book_id(cpu) (cpu_book_id[cpu])
35#define topology_book_cpumask(cpu) (&cpu_book_map[cpu])
36
Heiko Carstens83a24e32011-12-27 11:27:09 +010037int topology_cpu_init(struct cpu *);
Heiko Carstensc10fde02008-04-17 07:46:13 +020038int topology_set_cpu_management(int fc);
39void topology_schedule_update(void);
Heiko Carstens96f4a702010-10-25 16:10:54 +020040void store_topology(struct sysinfo_15_1_x *info);
Heiko Carstensd68bddb2011-12-27 11:27:16 +010041void topology_expect_change(void);
Heiko Carstensc10fde02008-04-17 07:46:13 +020042
Heiko Carstens83a24e32011-12-27 11:27:09 +010043#else /* CONFIG_SCHED_BOOK */
44
45static inline void topology_schedule_update(void) { }
46static inline int topology_cpu_init(struct cpu *cpu) { return 0; }
Heiko Carstensd68bddb2011-12-27 11:27:16 +010047static inline void topology_expect_change(void) { }
Heiko Carstens83a24e32011-12-27 11:27:09 +010048
49#endif /* CONFIG_SCHED_BOOK */
50
51#define POLARIZATION_UNKNOWN (-1)
Heiko Carstensc10fde02008-04-17 07:46:13 +020052#define POLARIZATION_HRZ (0)
53#define POLARIZATION_VL (1)
54#define POLARIZATION_VM (2)
55#define POLARIZATION_VH (3)
56
Heiko Carstens83a24e32011-12-27 11:27:09 +010057#ifdef CONFIG_SCHED_BOOK
Heiko Carstensdbd70fb2008-04-17 07:46:12 +020058void s390_init_cpu_topology(void);
59#else
60static inline void s390_init_cpu_topology(void)
61{
62};
63#endif
64
Heiko Carstens4cb14bc2010-08-31 10:28:18 +020065#define SD_BOOK_INIT SD_CPU_INIT
66
Linus Torvalds1da177e2005-04-16 15:20:36 -070067#include <asm-generic/topology.h>
68
69#endif /* _ASM_S390_TOPOLOGY_H */