summaryrefslogtreecommitdiffstats
path: root/arch/kvx/include/asm/cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/kvx/include/asm/cache.h')
-rw-r--r--arch/kvx/include/asm/cache.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/kvx/include/asm/cache.h b/arch/kvx/include/asm/cache.h
new file mode 100644
index 0000000000..72de5d804f
--- /dev/null
+++ b/arch/kvx/include/asm/cache.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (C) 2019 Kalray Inc.
+ */
+
+#ifndef __KVX_CACHE_H
+#define __KVX_CACHE_H
+
+#include <linux/types.h>
+
+void invalidate_dcache_range(unsigned long addr, unsigned long stop);
+
+#define sync_caches_for_execution sync_caches_for_execution
+static inline void sync_caches_for_execution(void)
+{
+ __builtin_kvx_fence();
+ __builtin_kvx_iinval();
+ __builtin_kvx_barrier();
+}
+
+static inline void sync_dcache_icache(void)
+{
+ sync_caches_for_execution();
+}
+
+static inline void dcache_inval(void)
+{
+ __builtin_kvx_fence();
+ __builtin_kvx_dinval();
+}
+
+#include <asm-generic/cache.h>
+
+#endif /* __KVX_CACHE_H */