drm/panthor: Don't add write fences to the shared BOs
[drm/drm-misc.git] / arch / riscv / include / asm / fence.h
blob182db7930edc2214b51f747abc906dac207052ef
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #ifndef _ASM_RISCV_FENCE_H
3 #define _ASM_RISCV_FENCE_H
5 #define RISCV_FENCE_ASM(p, s) "\tfence " #p "," #s "\n"
6 #define RISCV_FENCE(p, s) \
7 ({ __asm__ __volatile__ (RISCV_FENCE_ASM(p, s) : : : "memory"); })
9 #ifdef CONFIG_SMP
10 #define RISCV_ACQUIRE_BARRIER RISCV_FENCE_ASM(r, rw)
11 #define RISCV_RELEASE_BARRIER RISCV_FENCE_ASM(rw, w)
12 #define RISCV_FULL_BARRIER RISCV_FENCE_ASM(rw, rw)
13 #else
14 #define RISCV_ACQUIRE_BARRIER
15 #define RISCV_RELEASE_BARRIER
16 #define RISCV_FULL_BARRIER
17 #endif
19 #endif /* _ASM_RISCV_FENCE_H */