topology.h 1.6 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3
#ifndef _ASM_S390_TOPOLOGY_H
#define _ASM_S390_TOPOLOGY_H

4 5
#include <linux/cpumask.h>

6
struct sysinfo_15_1_x;
7 8 9 10
struct cpu;

#ifdef CONFIG_SCHED_BOOK

11
struct cpu_topology_s390 {
M
Martin Schwidefsky 已提交
12
	unsigned short thread_id;
13 14 15
	unsigned short core_id;
	unsigned short socket_id;
	unsigned short book_id;
M
Martin Schwidefsky 已提交
16
	cpumask_t thread_mask;
17 18 19 20 21 22 23
	cpumask_t core_mask;
	cpumask_t book_mask;
};

extern struct cpu_topology_s390 cpu_topology[NR_CPUS];

#define topology_physical_package_id(cpu)	(cpu_topology[cpu].socket_id)
M
Martin Schwidefsky 已提交
24 25
#define topology_thread_id(cpu)			(cpu_topology[cpu].thread_id)
#define topology_thread_cpumask(cpu)		(&cpu_topology[cpu].thread_mask)
26 27 28 29
#define topology_core_id(cpu)			(cpu_topology[cpu].core_id)
#define topology_core_cpumask(cpu)		(&cpu_topology[cpu].core_mask)
#define topology_book_id(cpu)			(cpu_topology[cpu].book_id)
#define topology_book_cpumask(cpu)		(&cpu_topology[cpu].book_mask)
30

31
#define mc_capable() 1
32

33
int topology_cpu_init(struct cpu *);
H
Heiko Carstens 已提交
34 35
int topology_set_cpu_management(int fc);
void topology_schedule_update(void);
36
void store_topology(struct sysinfo_15_1_x *info);
37
void topology_expect_change(void);
38
const struct cpumask *cpu_coregroup_mask(int cpu);
H
Heiko Carstens 已提交
39

40 41 42 43
#else /* CONFIG_SCHED_BOOK */

static inline void topology_schedule_update(void) { }
static inline int topology_cpu_init(struct cpu *cpu) { return 0; }
44
static inline void topology_expect_change(void) { }
45 46 47 48

#endif /* CONFIG_SCHED_BOOK */

#define POLARIZATION_UNKNOWN	(-1)
H
Heiko Carstens 已提交
49 50 51 52 53
#define POLARIZATION_HRZ	(0)
#define POLARIZATION_VL		(1)
#define POLARIZATION_VM		(2)
#define POLARIZATION_VH		(3)

L
Linus Torvalds 已提交
54 55 56
#include <asm-generic/topology.h>

#endif /* _ASM_S390_TOPOLOGY_H */