18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef __BARRIER_H 38c2ecf20Sopenharmony_ci#define __BARRIER_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#define mb() __asm__ __volatile__("mb": : :"memory") 68c2ecf20Sopenharmony_ci#define rmb() __asm__ __volatile__("mb": : :"memory") 78c2ecf20Sopenharmony_ci#define wmb() __asm__ __volatile__("wmb": : :"memory") 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#define __smp_load_acquire(p) \ 108c2ecf20Sopenharmony_ci({ \ 118c2ecf20Sopenharmony_ci compiletime_assert_atomic_type(*p); \ 128c2ecf20Sopenharmony_ci __READ_ONCE(*p); \ 138c2ecf20Sopenharmony_ci}) 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci#ifdef CONFIG_SMP 168c2ecf20Sopenharmony_ci#define __ASM_SMP_MB "\tmb\n" 178c2ecf20Sopenharmony_ci#else 188c2ecf20Sopenharmony_ci#define __ASM_SMP_MB 198c2ecf20Sopenharmony_ci#endif 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci#include <asm-generic/barrier.h> 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci#endif /* __BARRIER_H */ 24