Re: [PATCH] riscv: atomic: Using ARCH_ATOMIC in asm/atomic.h

2021-04-16 Thread Guo Ren
On Thu, Apr 15, 2021 at 4:52 PM Peter Zijlstra wrote: > > On Thu, Apr 15, 2021 at 07:39:22AM +, guo...@kernel.org wrote: > > - Add atomic_andnot_* operation > > > @@ -76,6 +59,12 @@ ATOMIC_OPS(sub, add, -i) > > ATOMIC_OPS(and, and, i) > > ATOMIC_OPS( or, or, i) > > ATOMIC_OPS(xor, xor,

Re: [PATCH] riscv: atomic: Using ARCH_ATOMIC in asm/atomic.h

2021-04-15 Thread Guo Ren
Sorry, forgot riscv32. I would fix that. On Thu, Apr 15, 2021 at 4:52 PM Peter Zijlstra wrote: > > On Thu, Apr 15, 2021 at 07:39:22AM +, guo...@kernel.org wrote: > > - Add atomic_andnot_* operation > > > @@ -76,6 +59,12 @@ ATOMIC_OPS(sub, add, -i) > > ATOMIC_OPS(and, and, i) > >

Re: [PATCH] riscv: atomic: Using ARCH_ATOMIC in asm/atomic.h

2021-04-15 Thread Peter Zijlstra
On Thu, Apr 15, 2021 at 07:39:22AM +, guo...@kernel.org wrote: > - Add atomic_andnot_* operation > @@ -76,6 +59,12 @@ ATOMIC_OPS(sub, add, -i) > ATOMIC_OPS(and, and, i) > ATOMIC_OPS( or, or, i) > ATOMIC_OPS(xor, xor, i) > +ATOMIC_OPS(andnot, and, -i) ~i, surely.

[PATCH] riscv: atomic: Using ARCH_ATOMIC in asm/atomic.h

2021-04-15 Thread guoren
From: Guo Ren The linux/atomic-arch-fallback.h has been there for a while, but only x86 & arm64 support it. Let's make riscv follow the linux/arch/* development trendy and make the codes more readable and maintainable. This patch also cleanup some codes: - Add atomic_andnot_* operation -