hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
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
+int cpu_relative_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,10 @@
6162 */
6263 return (nid < 0) ? 0 : nid;
6364 }
65
+
66
+int of_drconf_to_nid_single(struct drmem_lmb *lmb);
67
+void update_numa_distance(struct device_node *node);
68
+
6469 #else
6570
6671 static inline int early_cpu_to_node(int cpu) { return 0; }
....@@ -77,47 +82,39 @@
7782 {
7883 }
7984
80
-static inline int numa_update_cpu_topology(bool cpus_locked)
85
+static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) {}
86
+
87
+static inline int cpu_relative_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc)
8188 {
8289 return 0;
8390 }
8491
85
-static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) {}
92
+static inline int of_drconf_to_nid_single(struct drmem_lmb *lmb)
93
+{
94
+ return first_online_node;
95
+}
8696
97
+static inline void update_numa_distance(struct device_node *node) {}
8798 #endif /* CONFIG_NUMA */
8899
89100 #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);
93101 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);
102
+extern int cpu_to_coregroup_id(int cpu);
96103 #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
-}
109104 static inline int find_and_online_cpu_nid(int cpu)
110105 {
111106 return 0;
112107 }
113
-static inline int timed_topology_update(int nsecs)
108
+
109
+static inline int cpu_to_coregroup_id(int cpu)
114110 {
111
+#ifdef CONFIG_SMP
112
+ return cpu_to_core_id(cpu);
113
+#else
115114 return 0;
115
+#endif
116116 }
117117
118
-#ifdef CONFIG_SMP
119
-static inline void shared_proc_topology_init(void) {}
120
-#endif
121118 #endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */
122119
123120 #include <asm-generic/topology.h>
....@@ -129,11 +126,11 @@
129126 #include <asm/smp.h>
130127
131128 #define topology_physical_package_id(cpu) (cpu_to_chip_id(cpu))
129
+
132130 #define topology_sibling_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu))
133
-#define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu))
131
+#define topology_core_cpumask(cpu) (cpu_cpu_mask(cpu))
134132 #define topology_core_id(cpu) (cpu_to_core_id(cpu))
135133
136
-int dlpar_cpu_readd(int cpu);
137134 #endif
138135 #endif
139136