s390/mm: make arch_add_memory() NUMA aware
[deliverable/linux.git] / arch / s390 / include / asm / topology.h
CommitLineData
1da177e4
LT
1#ifndef _ASM_S390_TOPOLOGY_H
2#define _ASM_S390_TOPOLOGY_H
3
dbd70fb4
HC
4#include <linux/cpumask.h>
5
78609132 6struct sysinfo_15_1_x;
83a24e32
HC
7struct cpu;
8
9#ifdef CONFIG_SCHED_BOOK
10
d1e57508 11struct cpu_topology_s390 {
10ad34bc 12 unsigned short thread_id;
d1e57508
HC
13 unsigned short core_id;
14 unsigned short socket_id;
15 unsigned short book_id;
10ad34bc 16 cpumask_t thread_mask;
d1e57508
HC
17 cpumask_t core_mask;
18 cpumask_t book_mask;
19};
20
da0c636e
HC
21DECLARE_PER_CPU(struct cpu_topology_s390, cpu_topology);
22
23#define topology_physical_package_id(cpu) (per_cpu(cpu_topology, cpu).socket_id)
24#define topology_thread_id(cpu) (per_cpu(cpu_topology, cpu).thread_id)
06931e62
BG
25#define topology_sibling_cpumask(cpu) \
26 (&per_cpu(cpu_topology, cpu).thread_mask)
da0c636e
HC
27#define topology_core_id(cpu) (per_cpu(cpu_topology, cpu).core_id)
28#define topology_core_cpumask(cpu) (&per_cpu(cpu_topology, cpu).core_mask)
29#define topology_book_id(cpu) (per_cpu(cpu_topology, cpu).book_id)
30#define topology_book_cpumask(cpu) (&per_cpu(cpu_topology, cpu).book_mask)
658e5ce7 31
d1e57508 32#define mc_capable() 1
d00aa4e7 33
83a24e32 34int topology_cpu_init(struct cpu *);
c10fde0d
HC
35int topology_set_cpu_management(int fc);
36void topology_schedule_update(void);
96f4a70d 37void store_topology(struct sysinfo_15_1_x *info);
d68bddb7 38void topology_expect_change(void);
2dfd7476 39const struct cpumask *cpu_coregroup_mask(int cpu);
c10fde0d 40
83a24e32
HC
41#else /* CONFIG_SCHED_BOOK */
42
43static inline void topology_schedule_update(void) { }
44static inline int topology_cpu_init(struct cpu *cpu) { return 0; }
d68bddb7 45static inline void topology_expect_change(void) { }
83a24e32
HC
46
47#endif /* CONFIG_SCHED_BOOK */
48
49#define POLARIZATION_UNKNOWN (-1)
c10fde0d
HC
50#define POLARIZATION_HRZ (0)
51#define POLARIZATION_VL (1)
52#define POLARIZATION_VM (2)
53#define POLARIZATION_VH (3)
54
1da177e4
LT
55#include <asm-generic/topology.h>
56
57#endif /* _ASM_S390_TOPOLOGY_H */
This page took 0.742063 seconds and 5 git commands to generate.