barrier.h (507B)
1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef __BARRIER_H 3#define __BARRIER_H 4 5#define mb() __asm__ __volatile__("mb": : :"memory") 6#define rmb() __asm__ __volatile__("mb": : :"memory") 7#define wmb() __asm__ __volatile__("wmb": : :"memory") 8 9#define __smp_load_acquire(p) \ 10({ \ 11 compiletime_assert_atomic_type(*p); \ 12 __READ_ONCE(*p); \ 13}) 14 15#ifdef CONFIG_SMP 16#define __ASM_SMP_MB "\tmb\n" 17#else 18#define __ASM_SMP_MB 19#endif 20 21#include <asm-generic/barrier.h> 22 23#endif /* __BARRIER_H */