mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-23 11:04:44 +08:00
93ea02bb84
We're going to be adding a few new barrier primitives, and in order to avoid endless duplication make more agressive use of asm-generic/barrier.h. Change the asm-generic/barrier.h such that it allows partial barrier definitions and fills out the rest with defaults. There are a few architectures (m32r, m68k) that could probably do away with their barrier.h file entirely but are kept for now due to their unconventional nop() implementation. Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Michael Ellerman <michael@ellerman.id.au> Cc: Michael Neuling <mikey@neuling.org> Cc: Russell King <linux@arm.linux.org.uk> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Victor Kaplansky <VICTORK@il.ibm.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Link: http://lkml.kernel.org/r/20131213150640.846368594@infradead.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
33 lines
788 B
C
33 lines
788 B
C
/*
|
|
* Copyright 2004-2009 Analog Devices Inc.
|
|
* Tony Kou (tonyko@lineo.ca)
|
|
*
|
|
* Licensed under the GPL-2 or later
|
|
*/
|
|
|
|
#ifndef _BLACKFIN_BARRIER_H
|
|
#define _BLACKFIN_BARRIER_H
|
|
|
|
#include <asm/cache.h>
|
|
|
|
#define nop() __asm__ __volatile__ ("nop;\n\t" : : )
|
|
|
|
/*
|
|
* Force strict CPU ordering.
|
|
*/
|
|
#ifdef CONFIG_SMP
|
|
|
|
#ifdef __ARCH_SYNC_CORE_DCACHE
|
|
/* Force Core data cache coherence */
|
|
# define mb() do { barrier(); smp_check_barrier(); smp_mark_barrier(); } while (0)
|
|
# define rmb() do { barrier(); smp_check_barrier(); } while (0)
|
|
# define wmb() do { barrier(); smp_mark_barrier(); } while (0)
|
|
# define read_barrier_depends() do { barrier(); smp_check_barrier(); } while (0)
|
|
#endif
|
|
|
|
#endif /* !CONFIG_SMP */
|
|
|
|
#include <asm-generic/barrier.h>
|
|
|
|
#endif /* _BLACKFIN_BARRIER_H */
|