OSDN Git Service

tools: Add atomic_test_and_set_bit()
authorPeter Gonda <pgonda@google.com>
Thu, 6 Oct 2022 00:34:06 +0000 (00:34 +0000)
committerSean Christopherson <seanjc@google.com>
Thu, 17 Nov 2022 00:58:52 +0000 (16:58 -0800)
commitcf4694be2b2cf74945e50d39a02ea2307c4495f4
tree74389c8ce3d4978a99def91aa5f9a259a61437fb
parentdc88244bf5488b04fb7bbe47d8d9c38ff8f7dbb4
tools: Add atomic_test_and_set_bit()

Add x86 and generic implementations of atomic_test_and_set_bit() to allow
KVM selftests to atomically manage bitmaps.

Note, the generic version is taken from arch_test_and_set_bit() as of
commit 415d83249709 ("locking/atomic: Make test_and_*_bit() ordered on
failure").

Signed-off-by: Peter Gonda <pgonda@google.com>
Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20221006003409.649993-5-seanjc@google.com
tools/arch/x86/include/asm/atomic.h
tools/include/asm-generic/atomic-gcc.h