Merge tag 'arc-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc
[linux-2.6-microblaze.git] / arch / nds32 / include / asm / cacheflush.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 // Copyright (C) 2005-2017 Andes Technology Corporation
3
4 #ifndef __NDS32_CACHEFLUSH_H__
5 #define __NDS32_CACHEFLUSH_H__
6
7 #include <linux/mm.h>
8
9 #define PG_dcache_dirty PG_arch_1
10
11 void flush_icache_range(unsigned long start, unsigned long end);
12 #define flush_icache_range flush_icache_range
13
14 void flush_icache_page(struct vm_area_struct *vma, struct page *page);
15 #define flush_icache_page flush_icache_page
16
17 #ifdef CONFIG_CPU_CACHE_ALIASING
18 void flush_cache_mm(struct mm_struct *mm);
19 void flush_cache_dup_mm(struct mm_struct *mm);
20 void flush_cache_range(struct vm_area_struct *vma,
21                        unsigned long start, unsigned long end);
22 void flush_cache_page(struct vm_area_struct *vma,
23                       unsigned long addr, unsigned long pfn);
24 void flush_cache_kmaps(void);
25 void flush_cache_vmap(unsigned long start, unsigned long end);
26 void flush_cache_vunmap(unsigned long start, unsigned long end);
27
28 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
29 void flush_dcache_page(struct page *page);
30 void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
31                        unsigned long vaddr, void *dst, void *src, int len);
32 void copy_from_user_page(struct vm_area_struct *vma, struct page *page,
33                          unsigned long vaddr, void *dst, void *src, int len);
34
35 #define ARCH_HAS_FLUSH_ANON_PAGE
36 void flush_anon_page(struct vm_area_struct *vma,
37                      struct page *page, unsigned long vaddr);
38
39 #define ARCH_IMPLEMENTS_FLUSH_KERNEL_VMAP_RANGE 1
40 void flush_kernel_vmap_range(void *addr, int size);
41 void invalidate_kernel_vmap_range(void *addr, int size);
42 #define flush_dcache_mmap_lock(mapping)   xa_lock_irq(&(mapping)->i_pages)
43 #define flush_dcache_mmap_unlock(mapping) xa_unlock_irq(&(mapping)->i_pages)
44
45 #else
46 void flush_icache_user_page(struct vm_area_struct *vma, struct page *page,
47                              unsigned long addr, int len);
48 #define flush_icache_user_page flush_icache_user_page
49
50 #include <asm-generic/cacheflush.h>
51 #endif
52
53 #endif /* __NDS32_CACHEFLUSH_H__ */