We'd like all architectures to convert to ARCH_ATOMIC, as once all architectures are converted it will be possible to make significant cleanups to the atomics headers, and this will make it much easier to generically enable atomic functionality (e.g. debug logic in the instrumented wrappers). As a step towards that, this patch migrates ia64 to ARCH_ATOMIC. The arch code provides arch_{atomic,atomic64,xchg,cmpxchg}*(), and common code wraps these with optional instrumentation to provide the regular functions. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Will Deacon <will@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20210525140232.53872-20-mark.rutland@arm.com
16 lines
479 B
C
16 lines
479 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ASM_IA64_CMPXCHG_H
|
|
#define _ASM_IA64_CMPXCHG_H
|
|
|
|
#include <uapi/asm/cmpxchg.h>
|
|
|
|
#define arch_xchg(ptr, x) \
|
|
({(__typeof__(*(ptr))) __xchg((unsigned long) (x), (ptr), sizeof(*(ptr)));})
|
|
|
|
#define arch_cmpxchg(ptr, o, n) cmpxchg_acq((ptr), (o), (n))
|
|
#define arch_cmpxchg64(ptr, o, n) cmpxchg_acq((ptr), (o), (n))
|
|
|
|
#define arch_cmpxchg_local arch_cmpxchg
|
|
#define arch_cmpxchg64_local arch_cmpxchg64
|
|
|
|
#endif /* _ASM_IA64_CMPXCHG_H */
|