]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - arch/s390/include/asm/topology.h
Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[mirror_ubuntu-artful-kernel.git] / arch / s390 / include / asm / topology.h
CommitLineData
1da177e4
LT
1#ifndef _ASM_S390_TOPOLOGY_H
2#define _ASM_S390_TOPOLOGY_H
3
dbd70fb4 4#include <linux/cpumask.h>
3a368f74 5#include <asm/numa.h>
dbd70fb4 6
78609132 7struct sysinfo_15_1_x;
83a24e32
HC
8struct cpu;
9
9236b4dd 10#ifdef CONFIG_SCHED_TOPOLOGY
83a24e32 11
d1e57508 12struct cpu_topology_s390 {
10ad34bc 13 unsigned short thread_id;
d1e57508
HC
14 unsigned short core_id;
15 unsigned short socket_id;
16 unsigned short book_id;
adac0f1e 17 unsigned short drawer_id;
3a368f74 18 unsigned short node_id;
10ad34bc 19 cpumask_t thread_mask;
d1e57508
HC
20 cpumask_t core_mask;
21 cpumask_t book_mask;
adac0f1e 22 cpumask_t drawer_mask;
d1e57508
HC
23};
24
30fc4ca2 25extern struct cpu_topology_s390 cpu_topology[NR_CPUS];
8c910580 26extern cpumask_t cpus_with_topology;
30fc4ca2
HC
27
28#define topology_physical_package_id(cpu) (cpu_topology[cpu].socket_id)
29#define topology_thread_id(cpu) (cpu_topology[cpu].thread_id)
30#define topology_sibling_cpumask(cpu) (&cpu_topology[cpu].thread_mask)
31#define topology_core_id(cpu) (cpu_topology[cpu].core_id)
32#define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_mask)
33#define topology_book_id(cpu) (cpu_topology[cpu].book_id)
34#define topology_book_cpumask(cpu) (&cpu_topology[cpu].book_mask)
35#define topology_drawer_id(cpu) (cpu_topology[cpu].drawer_id)
36#define topology_drawer_cpumask(cpu) (&cpu_topology[cpu].drawer_mask)
658e5ce7 37
d1e57508 38#define mc_capable() 1
d00aa4e7 39
8c910580 40void topology_init_early(void);
83a24e32 41int topology_cpu_init(struct cpu *);
c10fde0d
HC
42int topology_set_cpu_management(int fc);
43void topology_schedule_update(void);
96f4a70d 44void store_topology(struct sysinfo_15_1_x *info);
d68bddb7 45void topology_expect_change(void);
2dfd7476 46const struct cpumask *cpu_coregroup_mask(int cpu);
c10fde0d 47
9236b4dd 48#else /* CONFIG_SCHED_TOPOLOGY */
83a24e32 49
8c910580 50static inline void topology_init_early(void) { }
83a24e32
HC
51static inline void topology_schedule_update(void) { }
52static inline int topology_cpu_init(struct cpu *cpu) { return 0; }
d68bddb7 53static inline void topology_expect_change(void) { }
83a24e32 54
9236b4dd 55#endif /* CONFIG_SCHED_TOPOLOGY */
83a24e32
HC
56
57#define POLARIZATION_UNKNOWN (-1)
c10fde0d
HC
58#define POLARIZATION_HRZ (0)
59#define POLARIZATION_VL (1)
60#define POLARIZATION_VM (2)
61#define POLARIZATION_VH (3)
62
3a368f74
PH
63#define SD_BOOK_INIT SD_CPU_INIT
64
65#ifdef CONFIG_NUMA
66
67#define cpu_to_node cpu_to_node
68static inline int cpu_to_node(int cpu)
69{
30fc4ca2 70 return cpu_topology[cpu].node_id;
3a368f74
PH
71}
72
73/* Returns a pointer to the cpumask of CPUs on node 'node'. */
74#define cpumask_of_node cpumask_of_node
75static inline const struct cpumask *cpumask_of_node(int node)
76{
22be9cd9 77 return &node_to_cpumask_map[node];
3a368f74
PH
78}
79
80/*
81 * Returns the number of the node containing node 'node'. This
82 * architecture is flat, so it is a pretty simple function!
83 */
84#define parent_node(node) (node)
85
86#define pcibus_to_node(bus) __pcibus_to_node(bus)
87
88#define node_distance(a, b) __node_distance(a, b)
89
90#else /* !CONFIG_NUMA */
91
92#define numa_node_id numa_node_id
93static inline int numa_node_id(void)
94{
95 return 0;
96}
97
98#endif /* CONFIG_NUMA */
99
1da177e4
LT
100#include <asm-generic/topology.h>
101
102#endif /* _ASM_S390_TOPOLOGY_H */