Merge tag 'pm-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
[sfrench/cifs-2.6.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 #ifdef CONFIG_CPU_CACHE_ALIASING
12 void flush_cache_mm(struct mm_struct *mm);
13 void flush_cache_dup_mm(struct mm_struct *mm);
14 void flush_cache_range(struct vm_area_struct *vma,
15                        unsigned long start, unsigned long end);
16 void flush_cache_page(struct vm_area_struct *vma,
17                       unsigned long addr, unsigned long pfn);
18 void flush_cache_kmaps(void);
19 void flush_cache_vmap(unsigned long start, unsigned long end);
20 void flush_cache_vunmap(unsigned long start, unsigned long end);
21
22 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
23 void flush_dcache_page(struct page *page);
24 void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
25                        unsigned long vaddr, void *dst, void *src, int len);
26 void copy_from_user_page(struct vm_area_struct *vma, struct page *page,
27                          unsigned long vaddr, void *dst, void *src, int len);
28
29 #define ARCH_HAS_FLUSH_ANON_PAGE
30 void flush_anon_page(struct vm_area_struct *vma,
31                      struct page *page, unsigned long vaddr);
32
33 #define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
34 void flush_kernel_dcache_page(struct page *page);
35 void flush_icache_range(unsigned long start, unsigned long end);
36 void flush_icache_page(struct vm_area_struct *vma, struct page *page);
37 #define flush_dcache_mmap_lock(mapping)   spin_lock_irq(&(mapping)->tree_lock)
38 #define flush_dcache_mmap_unlock(mapping) spin_unlock_irq(&(mapping)->tree_lock)
39
40 #else
41 #include <asm-generic/cacheflush.h>
42 #endif
43
44 #endif /* __NDS32_CACHEFLUSH_H__ */