• Mark Rutland's avatar
    locking/atomic: atomic: support ARCH_ATOMIC · f8b6455a
    Mark Rutland authored
    We'd like all architectures to convert to ARCH_ATOMIC, as this will
    enable functionality, and once all architectures are converted it will
    be possible to make significant cleanups to the atomic headers.
    
    A number of architectures use asm-generic/atomic.h, and it's impractical
    to convert the header and all these architectures in one go. To make it
    possible to convert them one-by-one, let's make the asm-generic
    implementation function as either atomic_*() or arch_atomic_*()
    depending on whether ARCH_ATOMIC is selected. To do this, the C
    implementations are prefixed as generic_atomic_*(), and preprocessor
    definitions map atomic_*()/arch_atomic_*() onto these as
    appropriate.
    
    Once all users are moved over to ARCH_ATOMIC the ifdeffery in the header
    can be simplified and/or removed entirely.
    
    For existing users (none of which select ARCH_ATOMIC), there should be
    no functional change as a result of this patch.
    Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Boqun Feng <boqun.feng@gmail.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://lore.kernel.org/r/20210525140232.53872-10-mark.rutland@arm.com
    f8b6455a
atomic.h 4.55 KB