Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

locking/atomic: parisc: add preprocessor symbols

Some atomics can be implemented in several different ways, e.g.
FULL/ACQUIRE/RELEASE ordered atomics can be implemented in terms of
RELAXED atomics, and ACQUIRE/RELEASE/RELAXED can be implemented in terms
of FULL ordered atomics. Other atomics are optional, and don't exist in
some configurations (e.g. not all architectures implement the 128-bit
cmpxchg ops).

Subsequent patches will require that architectures define a preprocessor
symbol for any atomic (or ordering variant) which is optional. This will
make the fallback ifdeffery more robust, and simplify future changes.

Add the required definitions to arch/parisc.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230605070124.3741859-10-mark.rutland@arm.com

authored by

Mark Rutland and committed by
Peter Zijlstra
07bf3dcb e50f06ce

+18
+18
arch/parisc/include/asm/atomic.h
··· 118 118 ATOMIC_OPS(add, +=) 119 119 ATOMIC_OPS(sub, -=) 120 120 121 + #define arch_atomic_add_return arch_atomic_add_return 122 + #define arch_atomic_sub_return arch_atomic_sub_return 123 + #define arch_atomic_fetch_add arch_atomic_fetch_add 124 + #define arch_atomic_fetch_sub arch_atomic_fetch_sub 125 + 121 126 #undef ATOMIC_OPS 122 127 #define ATOMIC_OPS(op, c_op) \ 123 128 ATOMIC_OP(op, c_op) \ ··· 131 126 ATOMIC_OPS(and, &=) 132 127 ATOMIC_OPS(or, |=) 133 128 ATOMIC_OPS(xor, ^=) 129 + 130 + #define arch_atomic_fetch_and arch_atomic_fetch_and 131 + #define arch_atomic_fetch_or arch_atomic_fetch_or 132 + #define arch_atomic_fetch_xor arch_atomic_fetch_xor 134 133 135 134 #undef ATOMIC_OPS 136 135 #undef ATOMIC_FETCH_OP ··· 190 181 ATOMIC64_OPS(add, +=) 191 182 ATOMIC64_OPS(sub, -=) 192 183 184 + #define arch_atomic64_add_return arch_atomic64_add_return 185 + #define arch_atomic64_sub_return arch_atomic64_sub_return 186 + #define arch_atomic64_fetch_add arch_atomic64_fetch_add 187 + #define arch_atomic64_fetch_sub arch_atomic64_fetch_sub 188 + 193 189 #undef ATOMIC64_OPS 194 190 #define ATOMIC64_OPS(op, c_op) \ 195 191 ATOMIC64_OP(op, c_op) \ ··· 203 189 ATOMIC64_OPS(and, &=) 204 190 ATOMIC64_OPS(or, |=) 205 191 ATOMIC64_OPS(xor, ^=) 192 + 193 + #define arch_atomic64_fetch_and arch_atomic64_fetch_and 194 + #define arch_atomic64_fetch_or arch_atomic64_fetch_or 195 + #define arch_atomic64_fetch_xor arch_atomic64_fetch_xor 206 196 207 197 #undef ATOMIC64_OPS 208 198 #undef ATOMIC64_FETCH_OP