diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2021-10-01 13:56:55 +0300 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2021-10-11 21:55:58 +0300 |
commit | fbbd140737121637b98aef53440c7a2676e412cf (patch) | |
tree | a220ffa0d1451c629bd8a3f75215ec6fa0ec85a6 | |
parent | 25d36a85c61b576401f69e0e205071e6b1befce8 (diff) | |
download | linux-fbbd140737121637b98aef53440c7a2676e412cf.tar.xz |
s390/barrier: factor out bcr_serialize()
Factor out bcr_serialize() inline assembly function which describes
what the bcr instruction is used for.
Use bcr_serialize() like before in mb(), but also in upcoming changes.
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
-rw-r--r-- | arch/s390/include/asm/barrier.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/arch/s390/include/asm/barrier.h b/arch/s390/include/asm/barrier.h index f9eddbca79d2..2c057e1f3200 100644 --- a/arch/s390/include/asm/barrier.h +++ b/arch/s390/include/asm/barrier.h @@ -16,20 +16,24 @@ #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES /* Fast-BCR without checkpoint synchronization */ -#define __ASM_BARRIER "bcr 14,0\n" +#define __ASM_BCR_SERIALIZE "bcr 14,0\n" #else -#define __ASM_BARRIER "bcr 15,0\n" +#define __ASM_BCR_SERIALIZE "bcr 15,0\n" #endif -#define mb() do { asm volatile(__ASM_BARRIER : : : "memory"); } while (0) +static __always_inline void bcr_serialize(void) +{ + asm volatile(__ASM_BCR_SERIALIZE : : : "memory"); +} -#define rmb() barrier() -#define wmb() barrier() -#define dma_rmb() mb() -#define dma_wmb() mb() -#define __smp_mb() mb() -#define __smp_rmb() rmb() -#define __smp_wmb() wmb() +#define mb() bcr_serialize() +#define rmb() barrier() +#define wmb() barrier() +#define dma_rmb() mb() +#define dma_wmb() mb() +#define __smp_mb() mb() +#define __smp_rmb() rmb() +#define __smp_wmb() wmb() #define __smp_store_release(p, v) \ do { \ |