1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2018 ARM Limited
5 #ifndef __COMPAT_BARRIER_H
6 #define __COMPAT_BARRIER_H
10 * Warning: This code is meant to be used with
11 * ENABLE_COMPAT_VDSO only.
13 #ifndef ENABLE_COMPAT_VDSO
14 #error This header is meant to be used with ENABLE_COMPAT_VDSO only
21 #define dmb(option) __asm__ __volatile__ ("dmb " #option : : : "memory")
23 #if __LINUX_ARM_ARCH__ >= 8 && defined(CONFIG_AS_DMB_ISHLD)
24 #define aarch32_smp_mb() dmb(ish)
25 #define aarch32_smp_rmb() dmb(ishld)
26 #define aarch32_smp_wmb() dmb(ishst)
28 #define aarch32_smp_mb() dmb(ish)
29 #define aarch32_smp_rmb() aarch32_smp_mb()
30 #define aarch32_smp_wmb() dmb(ishst)
38 #define smp_mb() aarch32_smp_mb()
39 #define smp_rmb() aarch32_smp_rmb()
40 #define smp_wmb() aarch32_smp_wmb()
42 #endif /* !__ASSEMBLY__ */
44 #endif /* __COMPAT_BARRIER_H */