cacheflush.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright (C) 2003 Microtronix Datacom Ltd.
  3. * Copyright (C) 2000-2002 Greg Ungerer <gerg@snapgear.com>
  4. *
  5. * This file is subject to the terms and conditions of the GNU General Public
  6. * License. See the file "COPYING" in the main directory of this archive
  7. * for more details.
  8. */
  9. #ifndef _ASM_NIOS2_CACHEFLUSH_H
  10. #define _ASM_NIOS2_CACHEFLUSH_H
  11. #include <linux/mm_types.h>
  12. /*
  13. * This flag is used to indicate that the page pointed to by a pte is clean
  14. * and does not require cleaning before returning it to the user.
  15. */
  16. #define PG_dcache_clean PG_arch_1
  17. struct mm_struct;
  18. extern void flush_cache_all(void);
  19. extern void flush_cache_mm(struct mm_struct *mm);
  20. extern void flush_cache_dup_mm(struct mm_struct *mm);
  21. extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
  22. unsigned long end);
  23. extern void flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr,
  24. unsigned long pfn);
  25. #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
  26. void flush_dcache_page(struct page *page);
  27. void flush_dcache_folio(struct folio *folio);
  28. #define flush_dcache_folio flush_dcache_folio
  29. extern void flush_icache_range(unsigned long start, unsigned long end);
  30. void flush_icache_pages(struct vm_area_struct *vma, struct page *page,
  31. unsigned int nr);
  32. #define flush_icache_pages flush_icache_pages
  33. #define flush_cache_vmap(start, end) flush_dcache_range(start, end)
  34. #define flush_cache_vmap_early(start, end) do { } while (0)
  35. #define flush_cache_vunmap(start, end) flush_dcache_range(start, end)
  36. extern void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
  37. unsigned long user_vaddr,
  38. void *dst, void *src, int len);
  39. extern void copy_from_user_page(struct vm_area_struct *vma, struct page *page,
  40. unsigned long user_vaddr,
  41. void *dst, void *src, int len);
  42. extern void flush_dcache_range(unsigned long start, unsigned long end);
  43. extern void invalidate_dcache_range(unsigned long start, unsigned long end);
  44. #define flush_dcache_mmap_lock(mapping) xa_lock_irq(&mapping->i_pages)
  45. #define flush_dcache_mmap_unlock(mapping) xa_unlock_irq(&mapping->i_pages)
  46. #define flush_dcache_mmap_lock_irqsave(mapping, flags) \
  47. xa_lock_irqsave(&mapping->i_pages, flags)
  48. #define flush_dcache_mmap_unlock_irqrestore(mapping, flags) \
  49. xa_unlock_irqrestore(&mapping->i_pages, flags)
  50. #endif /* _ASM_NIOS2_CACHEFLUSH_H */