/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2006 by Ralf Baechle (ralf@linux-mips.org)
*/ #ifndef __ASM_BARRIER_H #define __ASM_BARRIER_H
/* * When LL/SC does imply order, it must also be a compiler barrier to avoid the * compiler from reordering where the CPU will not. When it does not imply * order, the compiler is also free to reorder across the LL/SC loop and * ordering will be done by smp_llsc_mb() and friends.
*/ #ifdefined(CONFIG_WEAK_REORDERING_BEYOND_LLSC) && defined(CONFIG_SMP) # define __WEAK_LLSC_MB sync # define smp_llsc_mb() \
__asm__ __volatile__(__stringify(__WEAK_LLSC_MB) : : :"memory") # define __LLSC_CLOBBER #else # define __WEAK_LLSC_MB # define smp_llsc_mb() do { } while (0) # define __LLSC_CLOBBER "memory" #endif
#ifdef CONFIG_CPU_CAVIUM_OCTEON #define smp_mb__before_llsc() smp_wmb() #define __smp_mb__before_llsc() __smp_wmb() /* Cause previous writes to become visible on all CPUs as soon as possible */ #define nudge_writes() __asm__ __volatile__(".set push\n\t" \ ".set arch=octeon\n\t" \ "syncw\n\t" \ ".set pop" : : : "memory") #else #define smp_mb__before_llsc() smp_llsc_mb() #define __smp_mb__before_llsc() smp_llsc_mb() #define nudge_writes() mb() #endif
/* * In the Loongson3 LL/SC workaround case, all of our LL/SC loops already have * a completion barrier immediately preceding the LL instruction. Therefore we * can skip emitting a barrier from __smp_mb__before_atomic().
*/ #ifdef CONFIG_CPU_LOONGSON3_WORKAROUNDS # define __smp_mb__before_atomic() #else # define __smp_mb__before_atomic() __smp_mb__before_llsc() #endif
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.