mirror of https://gitee.com/openkylin/linux.git
powerpc: define __smp_xxx
This defines __smp_xxx barriers for powerpc for use by virtualization. smp_xxx barriers are removed as they are defined correctly by asm-generic/barriers.h This reduces the amount of arch-specific boiler-plate code. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Boqun Feng <boqun.feng@gmail.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
This commit is contained in:
parent
a9e4252a9b
commit
003472a93a
|
@ -44,19 +44,11 @@
|
||||||
#define dma_rmb() __lwsync()
|
#define dma_rmb() __lwsync()
|
||||||
#define dma_wmb() __asm__ __volatile__ (stringify_in_c(SMPWMB) : : :"memory")
|
#define dma_wmb() __asm__ __volatile__ (stringify_in_c(SMPWMB) : : :"memory")
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
#define __smp_lwsync() __lwsync()
|
||||||
#define smp_lwsync() __lwsync()
|
|
||||||
|
|
||||||
#define smp_mb() mb()
|
#define __smp_mb() mb()
|
||||||
#define smp_rmb() __lwsync()
|
#define __smp_rmb() __lwsync()
|
||||||
#define smp_wmb() __asm__ __volatile__ (stringify_in_c(SMPWMB) : : :"memory")
|
#define __smp_wmb() __asm__ __volatile__ (stringify_in_c(SMPWMB) : : :"memory")
|
||||||
#else
|
|
||||||
#define smp_lwsync() barrier()
|
|
||||||
|
|
||||||
#define smp_mb() barrier()
|
|
||||||
#define smp_rmb() barrier()
|
|
||||||
#define smp_wmb() barrier()
|
|
||||||
#endif /* CONFIG_SMP */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is a barrier which prevents following instructions from being
|
* This is a barrier which prevents following instructions from being
|
||||||
|
@ -67,18 +59,18 @@
|
||||||
#define data_barrier(x) \
|
#define data_barrier(x) \
|
||||||
asm volatile("twi 0,%0,0; isync" : : "r" (x) : "memory");
|
asm volatile("twi 0,%0,0; isync" : : "r" (x) : "memory");
|
||||||
|
|
||||||
#define smp_store_release(p, v) \
|
#define __smp_store_release(p, v) \
|
||||||
do { \
|
do { \
|
||||||
compiletime_assert_atomic_type(*p); \
|
compiletime_assert_atomic_type(*p); \
|
||||||
smp_lwsync(); \
|
__smp_lwsync(); \
|
||||||
WRITE_ONCE(*p, v); \
|
WRITE_ONCE(*p, v); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define smp_load_acquire(p) \
|
#define __smp_load_acquire(p) \
|
||||||
({ \
|
({ \
|
||||||
typeof(*p) ___p1 = READ_ONCE(*p); \
|
typeof(*p) ___p1 = READ_ONCE(*p); \
|
||||||
compiletime_assert_atomic_type(*p); \
|
compiletime_assert_atomic_type(*p); \
|
||||||
smp_lwsync(); \
|
__smp_lwsync(); \
|
||||||
___p1; \
|
___p1; \
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue