summaryrefslogtreecommitdiffstats
path: root/arch/kvx/include/asm/barrier.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/kvx/include/asm/barrier.h')
-rw-r--r--arch/kvx/include/asm/barrier.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/kvx/include/asm/barrier.h b/arch/kvx/include/asm/barrier.h
new file mode 100644
index 0000000000..616b5f90a2
--- /dev/null
+++ b/arch/kvx/include/asm/barrier.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (C) 2019 Kalray Inc.
+ */
+
+#ifndef _ASM_KVX_BARRIER_H
+#define _ASM_KVX_BARRIER_H
+
+/* fence is sufficient to guarantee write ordering */
+#define wmb() __builtin_kvx_fence()
+
+/* no L2 coherency, therefore rmb is D$ invalidation */
+#define rmb() __builtin_kvx_dinval()
+
+/* general memory barrier */
+#define mb() do { wmb(); rmb(); } while (0)
+
+#endif /* _ASM_KVX_BARRIER_H */