locking/generic: Wire up local{,64}_try_cmpxchg()
authorUros Bizjak <ubizjak@gmail.com>
Wed, 5 Apr 2023 14:17:07 +0000 (16:17 +0200)
committerIngo Molnar <mingo@kernel.org>
Sat, 29 Apr 2023 07:09:09 +0000 (09:09 +0200)
commit8fc4fddaf9a184eea7da21290236a1764e608a01
tree6443e9faadcb782b6cd239f34d74c4323d606567
parente6ce9d741163af0b846637ce6550ae8a671b1588
locking/generic: Wire up local{,64}_try_cmpxchg()

Implement generic support for local{,64}_try_cmpxchg().

Redirect to the atomic_ family of functions when the target
does not provide its own local.h definitions.

For 64-bit targets, implement local64_try_cmpxchg and
local64_cmpxchg using typed C wrappers that call local_
family of functions and provide additional checking
of their input arguments.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20230405141710.3551-3-ubizjak@gmail.com
Cc: Linus Torvalds <torvalds@linux-foundation.org>
include/asm-generic/local.h
include/asm-generic/local64.h