1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 2020 Loongson Technology Corporation Limited
4  */
5 #ifndef __ASM_TOPOLOGY_H
6 #define __ASM_TOPOLOGY_H
7 
8 #include <topology.h>
9 #include <linux/smp.h>
10 
11 #ifdef CONFIG_SMP
12 #define topology_physical_package_id(cpu)	(cpu_data[cpu].package)
13 #define topology_core_id(cpu)			(cpu_data[cpu].core)
14 #define topology_core_cpumask(cpu)		(&cpu_core_map[cpu])
15 #define topology_sibling_cpumask(cpu)		(&cpu_sibling_map[cpu])
16 #endif
17 
18 #include <asm-generic/topology.h>
19 
arch_fix_phys_package_id(int num, u32 slot)20 static inline void arch_fix_phys_package_id(int num, u32 slot) { }
21 #endif /* __ASM_TOPOLOGY_H */
22