csky: atomic: Add custom atomic.h implementation
authorGuo Ren <guoren@linux.alibaba.com>
Wed, 6 Apr 2022 12:47:52 +0000 (20:47 +0800)
committerGuo Ren <guoren@linux.alibaba.com>
Mon, 25 Apr 2022 05:51:42 +0000 (13:51 +0800)
commit6b160e0513e9f0b0c0b7ff4d5b964822d1750ce9
tree54bdf2974e9db25c8ee81426ead58fda082641cb
parent186f69b64c80a594337211e8238e44a3863e9d94
csky: atomic: Add custom atomic.h implementation

The generic atomic.h used cmpxchg to implement the atomic
operations, it will cause daul loop to reduce the forward
guarantee. The patch implement csky custom atomic operations with
ldex/stex instructions for the best performance.

Important comment by Rutland:
8e86f0b409a4 ("arm64: atomics: fix use of acquire + release for
full barrier semantics")

Link: https://lore.kernel.org/linux-riscv/CAJF2gTSAxpAi=LbAdu7jntZRUa=-dJwL0VfmDfBV5MHB=rcZ-w@mail.gmail.com/T/#m27a0f1342995deae49ce1d0e1f2683f8a181d6c3
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
arch/csky/include/asm/atomic.h [new file with mode: 0644]