linux/arch/hexagon
Mark Rutland 18cc1814d4 atomics/treewide: Make test ops optional
Some of the atomics return the result of a test applied after the atomic
operation, and almost all architectures implement these as trivial
wrappers around the underlying atomic. Specifically:

 * <atomic>_inc_and_test(v)    is (<atomic>_inc_return(v)    == 0)
 * <atomic>_dec_and_test(v)    is (<atomic>_dec_return(v)    == 0)
 * <atomic>_sub_and_test(i, v) is (<atomic>_sub_return(i, v) == 0)
 * <atomic>_add_negative(i, v) is (<atomic>_add_return(i, v)  < 0)

Rather than have these definitions duplicated in all architectures, with
minor inconsistencies in formatting and documentation, let's make these
operations optional, with default fallbacks as above. Implementations
must now provide a preprocessor symbol.

The instrumented atomics are updated accordingly.

Both x86 and m68k have custom implementations, which are left as-is,
given preprocessor symbols to avoid being overridden.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Palmer Dabbelt <palmer@sifive.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/lkml/20180621121321.4761-16-mark.rutland@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-06-21 14:25:24 +02:00
..
configs Hexagon: Comet platform support 2011-11-01 07:34:21 -07:00
include atomics/treewide: Make test ops optional 2018-06-21 14:25:24 +02:00
kernel hexagon: fix printk format warning in setup.c 2018-06-15 07:55:25 +09:00
lib hexagon: export csum_partial_copy_nocheck 2018-05-01 15:49:50 -05:00
mm hexagon: drop the unused variable zero_page_mask 2018-06-15 07:55:25 +09:00
Kconfig scatterlist: move the NEED_SG_DMA_LENGTH config symbol to lib/Kconfig 2018-05-09 06:55:59 +02:00
Makefile Kbuild updates for v4.15 2017-11-17 17:45:29 -08:00