diff options
author | Huacai Chen <chenhuacai@loongson.cn> | 2022-05-31 18:04:12 +0800 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2022-06-03 20:09:29 +0800 |
commit | 46859ac8af52ae599e1b51992ddef3eb43f295fc (patch) | |
tree | c1e6640316d5d8748bea046b71d2260b81cbe314 /arch/loongarch/include/asm/topology.h | |
parent | c6b99bed6b8f3255bd2f65a8e606352e0e638ad0 (diff) | |
download | lwn-46859ac8af52ae599e1b51992ddef3eb43f295fc.tar.gz lwn-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.h | 7 |
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> |