1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_BARRIER_H
3 #define __ASM_BARRIER_H
7 /* The synchronize caches instruction executes as a nop on systems in
8 which all memory references are performed in order. */
9 #define synchronize_caches() __asm__ __volatile__ ("sync" : : : "memory")
11 #if defined(CONFIG_SMP)
12 #define mb() do { synchronize_caches(); } while (0)
15 #define dma_rmb() mb()
16 #define dma_wmb() mb()
18 #define mb() barrier()
19 #define rmb() barrier()
20 #define wmb() barrier()
21 #define dma_rmb() barrier()
22 #define dma_wmb() barrier()
25 #define __smp_mb() mb()
26 #define __smp_rmb() mb()
27 #define __smp_wmb() mb()
29 #include <asm-generic/barrier.h>
31 #endif /* !__ASSEMBLY__ */
32 #endif /* __ASM_BARRIER_H */