@@ -112,6 +112,8 @@ extern const struct cpumask *cpu_clustergroup_mask(int cpu);
112112#define topology_core_id (cpu ) (cpu_data(cpu).topo.core_id)
113113#define topology_ppin (cpu ) (cpu_data(cpu).ppin)
114114
115+ #define topology_amd_node_id (cpu ) (cpu_data(cpu).topo.die_id)
116+
115117extern unsigned int __max_die_per_package ;
116118
117119#ifdef CONFIG_SMP
@@ -147,6 +149,11 @@ int topology_update_package_map(unsigned int apicid, unsigned int cpu);
147149int topology_update_die_map (unsigned int dieid , unsigned int cpu );
148150int topology_phys_to_logical_pkg (unsigned int pkg );
149151
152+ static inline unsigned int topology_amd_nodes_per_pkg (void )
153+ {
154+ return __max_die_per_package ;
155+ }
156+
150157extern struct cpumask __cpu_primary_thread_mask ;
151158#define cpu_primary_thread_mask ((const struct cpumask *)&__cpu_primary_thread_mask)
152159
@@ -159,15 +166,10 @@ static inline bool topology_is_primary_thread(unsigned int cpu)
159166 return cpumask_test_cpu (cpu , cpu_primary_thread_mask );
160167}
161168#else /* CONFIG_SMP */
162- #define topology_max_packages () (1)
163- static inline int
164- topology_update_package_map (unsigned int apicid , unsigned int cpu ) { return 0 ; }
165- static inline int
166- topology_update_die_map (unsigned int dieid , unsigned int cpu ) { return 0 ; }
167169static inline int topology_phys_to_logical_pkg (unsigned int pkg ) { return 0 ; }
168- static inline int topology_max_die_per_package (void ) { return 1 ; }
169170static inline int topology_max_smt_threads (void ) { return 1 ; }
170171static inline bool topology_is_primary_thread (unsigned int cpu ) { return true; }
172+ static inline unsigned int topology_amd_nodes_per_pkg (void ) { return 1 ; };
171173#endif /* !CONFIG_SMP */
172174
173175static inline void arch_fix_phys_package_id (int num , u32 slot )
0 commit comments