target: Fix kref->refcount underflow in transport_cmd_finish_abort
[linux/fpc-iii.git] / arch / s390 / include / asm / topology.h
blobf15f5571ca2b5e6bf64283e6588ac1560cc7238a
1 #ifndef _ASM_S390_TOPOLOGY_H
2 #define _ASM_S390_TOPOLOGY_H
4 #include <linux/cpumask.h>
5 #include <asm/numa.h>
7 struct sysinfo_15_1_x;
8 struct cpu;
10 #ifdef CONFIG_SCHED_TOPOLOGY
12 struct cpu_topology_s390 {
13 unsigned short thread_id;
14 unsigned short core_id;
15 unsigned short socket_id;
16 unsigned short book_id;
17 unsigned short drawer_id;
18 unsigned short node_id;
19 cpumask_t thread_mask;
20 cpumask_t core_mask;
21 cpumask_t book_mask;
22 cpumask_t drawer_mask;
25 DECLARE_PER_CPU(struct cpu_topology_s390, cpu_topology);
27 #define topology_physical_package_id(cpu) (per_cpu(cpu_topology, cpu).socket_id)
28 #define topology_thread_id(cpu) (per_cpu(cpu_topology, cpu).thread_id)
29 #define topology_sibling_cpumask(cpu) \
30 (&per_cpu(cpu_topology, cpu).thread_mask)
31 #define topology_core_id(cpu) (per_cpu(cpu_topology, cpu).core_id)
32 #define topology_core_cpumask(cpu) (&per_cpu(cpu_topology, cpu).core_mask)
33 #define topology_book_id(cpu) (per_cpu(cpu_topology, cpu).book_id)
34 #define topology_book_cpumask(cpu) (&per_cpu(cpu_topology, cpu).book_mask)
35 #define topology_drawer_id(cpu) (per_cpu(cpu_topology, cpu).drawer_id)
36 #define topology_drawer_cpumask(cpu) (&per_cpu(cpu_topology, cpu).drawer_mask)
38 #define mc_capable() 1
40 int topology_cpu_init(struct cpu *);
41 int topology_set_cpu_management(int fc);
42 void topology_schedule_update(void);
43 void store_topology(struct sysinfo_15_1_x *info);
44 void topology_expect_change(void);
45 const struct cpumask *cpu_coregroup_mask(int cpu);
47 #else /* CONFIG_SCHED_TOPOLOGY */
49 static inline void topology_schedule_update(void) { }
50 static inline int topology_cpu_init(struct cpu *cpu) { return 0; }
51 static inline void topology_expect_change(void) { }
53 #endif /* CONFIG_SCHED_TOPOLOGY */
55 #define POLARIZATION_UNKNOWN (-1)
56 #define POLARIZATION_HRZ (0)
57 #define POLARIZATION_VL (1)
58 #define POLARIZATION_VM (2)
59 #define POLARIZATION_VH (3)
61 #define SD_BOOK_INIT SD_CPU_INIT
63 #ifdef CONFIG_NUMA
65 #define cpu_to_node cpu_to_node
66 static inline int cpu_to_node(int cpu)
68 return per_cpu(cpu_topology, cpu).node_id;
71 /* Returns a pointer to the cpumask of CPUs on node 'node'. */
72 #define cpumask_of_node cpumask_of_node
73 static inline const struct cpumask *cpumask_of_node(int node)
75 return &node_to_cpumask_map[node];
79 * Returns the number of the node containing node 'node'. This
80 * architecture is flat, so it is a pretty simple function!
82 #define parent_node(node) (node)
84 #define pcibus_to_node(bus) __pcibus_to_node(bus)
86 #define node_distance(a, b) __node_distance(a, b)
88 #else /* !CONFIG_NUMA */
90 #define numa_node_id numa_node_id
91 static inline int numa_node_id(void)
93 return 0;
96 #endif /* CONFIG_NUMA */
98 #include <asm-generic/topology.h>
100 #endif /* _ASM_S390_TOPOLOGY_H */