hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/powerpc/include/asm/topology.h
....@@ -6,6 +6,7 @@
66
77 struct device;
88 struct device_node;
9
+struct drmem_lmb;
910
1011 #ifdef CONFIG_NUMA
1112
....@@ -35,6 +36,7 @@
3536 cpu_all_mask : \
3637 cpumask_of_node(pcibus_to_node(bus)))
3738
39
+extern int cpu_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc);
3840 extern int __node_distance(int, int);
3941 #define node_distance(a, b) __node_distance(a, b)
4042
....@@ -42,7 +44,6 @@
4244
4345 extern int sysfs_add_device_to_node(struct device *dev, int nid);
4446 extern void sysfs_remove_device_from_node(struct device *dev, int nid);
45
-extern int numa_update_cpu_topology(bool cpus_locked);
4647
4748 static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node)
4849 {
....@@ -61,6 +62,9 @@
6162 */
6263 return (nid < 0) ? 0 : nid;
6364 }
65
+
66
+int of_drconf_to_nid_single(struct drmem_lmb *lmb);
67
+
6468 #else
6569
6670 static inline int early_cpu_to_node(int cpu) { return 0; }
....@@ -77,47 +81,38 @@
7781 {
7882 }
7983
80
-static inline int numa_update_cpu_topology(bool cpus_locked)
84
+static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) {}
85
+
86
+static inline int cpu_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc)
8187 {
8288 return 0;
8389 }
8490
85
-static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) {}
91
+static inline int of_drconf_to_nid_single(struct drmem_lmb *lmb)
92
+{
93
+ return first_online_node;
94
+}
8695
8796 #endif /* CONFIG_NUMA */
8897
8998 #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR)
90
-extern int start_topology_update(void);
91
-extern int stop_topology_update(void);
92
-extern int prrn_is_enabled(void);
9399 extern int find_and_online_cpu_nid(int cpu);
94
-extern int timed_topology_update(int nsecs);
95
-extern void __init shared_proc_topology_init(void);
100
+extern int cpu_to_coregroup_id(int cpu);
96101 #else
97
-static inline int start_topology_update(void)
98
-{
99
- return 0;
100
-}
101
-static inline int stop_topology_update(void)
102
-{
103
- return 0;
104
-}
105
-static inline int prrn_is_enabled(void)
106
-{
107
- return 0;
108
-}
109102 static inline int find_and_online_cpu_nid(int cpu)
110103 {
111104 return 0;
112105 }
113
-static inline int timed_topology_update(int nsecs)
106
+
107
+static inline int cpu_to_coregroup_id(int cpu)
114108 {
109
+#ifdef CONFIG_SMP
110
+ return cpu_to_core_id(cpu);
111
+#else
115112 return 0;
113
+#endif
116114 }
117115
118
-#ifdef CONFIG_SMP
119
-static inline void shared_proc_topology_init(void) {}
120
-#endif
121116 #endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */
122117
123118 #include <asm-generic/topology.h>
....@@ -129,11 +124,11 @@
129124 #include <asm/smp.h>
130125
131126 #define topology_physical_package_id(cpu) (cpu_to_chip_id(cpu))
127
+
132128 #define topology_sibling_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu))
133
-#define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu))
129
+#define topology_core_cpumask(cpu) (cpu_cpu_mask(cpu))
134130 #define topology_core_id(cpu) (cpu_to_core_id(cpu))
135131
136
-int dlpar_cpu_readd(int cpu);
137132 #endif
138133 #endif
139134