cacheflush.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // SPDX-License-Identifier: GPL-2.0
  2. // Copyright (C) 2005-2017 Andes Technology Corporation
  3. #ifndef __NDS32_CACHEFLUSH_H__
  4. #define __NDS32_CACHEFLUSH_H__
  5. #include <linux/mm.h>
  6. #define PG_dcache_dirty PG_arch_1
  7. void flush_icache_range(unsigned long start, unsigned long end);
  8. void flush_icache_page(struct vm_area_struct *vma, struct page *page);
  9. #ifdef CONFIG_CPU_CACHE_ALIASING
  10. void flush_cache_mm(struct mm_struct *mm);
  11. void flush_cache_dup_mm(struct mm_struct *mm);
  12. void flush_cache_range(struct vm_area_struct *vma,
  13. unsigned long start, unsigned long end);
  14. void flush_cache_page(struct vm_area_struct *vma,
  15. unsigned long addr, unsigned long pfn);
  16. void flush_cache_kmaps(void);
  17. void flush_cache_vmap(unsigned long start, unsigned long end);
  18. void flush_cache_vunmap(unsigned long start, unsigned long end);
  19. #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
  20. void flush_dcache_page(struct page *page);
  21. void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
  22. unsigned long vaddr, void *dst, void *src, int len);
  23. void copy_from_user_page(struct vm_area_struct *vma, struct page *page,
  24. unsigned long vaddr, void *dst, void *src, int len);
  25. #define ARCH_HAS_FLUSH_ANON_PAGE
  26. void flush_anon_page(struct vm_area_struct *vma,
  27. struct page *page, unsigned long vaddr);
  28. #define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
  29. void flush_kernel_dcache_page(struct page *page);
  30. void flush_kernel_vmap_range(void *addr, int size);
  31. void invalidate_kernel_vmap_range(void *addr, int size);
  32. #define flush_dcache_mmap_lock(mapping) xa_lock_irq(&(mapping)->i_pages)
  33. #define flush_dcache_mmap_unlock(mapping) xa_unlock_irq(&(mapping)->i_pages)
  34. #else
  35. #include <asm-generic/cacheflush.h>
  36. #undef flush_icache_range
  37. #undef flush_icache_page
  38. #undef flush_icache_user_range
  39. void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
  40. unsigned long addr, int len);
  41. #endif
  42. #endif /* __NDS32_CACHEFLUSH_H__ */