summaryrefslogtreecommitdiffstats
path: root/arch/loongarch/include/asm/topology.h
diff options
context:
space:
mode:
authorHuacai Chen <chenhuacai@loongson.cn>2022-05-31 18:04:12 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2022-06-03 20:09:29 +0800
commit46859ac8af52ae599e1b51992ddef3eb43f295fc (patch)
treec1e6640316d5d8748bea046b71d2260b81cbe314 /arch/loongarch/include/asm/topology.h
parentc6b99bed6b8f3255bd2f65a8e606352e0e638ad0 (diff)
downloadlinux-stable-46859ac8af52ae599e1b51992ddef3eb43f295fc.tar.gz
linux-stable-46859ac8af52ae599e1b51992ddef3eb43f295fc.tar.bz2
linux-stable-46859ac8af52ae599e1b51992ddef3eb43f295fc.zip
LoongArch: Add multi-processor (SMP) support
LoongArch-based procesors have 4, 8 or 16 cores per package. This patch adds multi-processor (SMP) support for LoongArch. Reviewed-by: WANG Xuerui <git@xen0n.name> Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/include/asm/topology.h')
-rw-r--r--arch/loongarch/include/asm/topology.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/loongarch/include/asm/topology.h b/arch/loongarch/include/asm/topology.h
index 9ac71a25207a..da135841e5b1 100644
--- a/arch/loongarch/include/asm/topology.h
+++ b/arch/loongarch/include/asm/topology.h
@@ -7,7 +7,12 @@
#include <linux/smp.h>
-#define cpu_logical_map(cpu) 0
+#ifdef CONFIG_SMP
+#define topology_physical_package_id(cpu) (cpu_data[cpu].package)
+#define topology_core_id(cpu) (cpu_data[cpu].core)
+#define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
+#define topology_sibling_cpumask(cpu) (&cpu_sibling_map[cpu])
+#endif
#include <asm-generic/topology.h>