]> git.ipfire.org Git - thirdparty/linux.git/commit
LoongArch: Add atomic operations for 32BIT/64BIT
authorHuacai Chen <chenhuacai@loongson.cn>
Sat, 6 Dec 2025 02:40:32 +0000 (10:40 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Sat, 6 Dec 2025 02:40:32 +0000 (10:40 +0800)
commit79974cc3ba45f3884e9c18da92a62b198a18ca62
tree185d5dcaf908239d18c819938ea32a70a8aef64c
parentbf3fa8f232a1eec8d7b88dcd9e925e60f04f018d
LoongArch: Add atomic operations for 32BIT/64BIT

LoongArch64 has both AMO and LL/SC instructions, while LoongArch32 only
has LL/SC intstructions. So we add a Kconfig option CPU_HAS_AMO here and
implement atomic operations (also including local operations and percpu
operations) for both 32BIT and 64BIT platforms.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/Kconfig
arch/loongarch/include/asm/atomic-amo.h [new file with mode: 0644]
arch/loongarch/include/asm/atomic-llsc.h [new file with mode: 0644]
arch/loongarch/include/asm/atomic.h
arch/loongarch/include/asm/cmpxchg.h
arch/loongarch/include/asm/local.h
arch/loongarch/include/asm/percpu.h