1 /* SPDX-License-Identifier: GPL-2.0 */
2 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
4 #ifndef __ABI_CSKY_CACHEFLUSH_H
5 #define __ABI_CSKY_CACHEFLUSH_H
7 #include <linux/compiler.h>
8 #include <asm/string.h>
11 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
12 extern void flush_dcache_page(struct page
*);
14 #define flush_cache_mm(mm) cache_wbinv_all()
15 #define flush_cache_page(vma, page, pfn) cache_wbinv_all()
16 #define flush_cache_dup_mm(mm) cache_wbinv_all()
19 * if (current_mm != vma->mm) cache_wbinv_range(start, end) will be broken.
20 * Use cache_wbinv_all() here and need to be improved in future.
22 #define flush_cache_range(vma, start, end) cache_wbinv_all()
23 #define flush_cache_vmap(start, end) cache_wbinv_range(start, end)
24 #define flush_cache_vunmap(start, end) cache_wbinv_range(start, end)
26 #define flush_icache_page(vma, page) cache_wbinv_all()
27 #define flush_icache_range(start, end) cache_wbinv_range(start, end)
29 #define flush_icache_user_range(vma, pg, adr, len) \
30 cache_wbinv_range(adr, adr + len)
32 #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
35 memcpy(dst, src, len); \
39 #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
42 memcpy(dst, src, len); \
46 #define flush_dcache_mmap_lock(mapping) do {} while (0)
47 #define flush_dcache_mmap_unlock(mapping) do {} while (0)
49 #endif /* __ABI_CSKY_CACHEFLUSH_H */