cacheflush.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef _ASM_SCORE_CACHEFLUSH_H
  2. #define _ASM_SCORE_CACHEFLUSH_H
  3. /* Keep includes the same across arches. */
  4. #include <linux/mm.h>
  5. extern void flush_cache_all(void);
  6. extern void flush_cache_mm(struct mm_struct *mm);
  7. extern void flush_cache_range(struct vm_area_struct *vma,
  8. unsigned long start, unsigned long end);
  9. extern void flush_cache_page(struct vm_area_struct *vma,
  10. unsigned long page, unsigned long pfn);
  11. extern void flush_cache_sigtramp(unsigned long addr);
  12. extern void flush_icache_all(void);
  13. extern void flush_icache_range(unsigned long start, unsigned long end);
  14. extern void flush_dcache_range(unsigned long start, unsigned long end);
  15. extern void flush_dcache_page(struct page *page);
  16. #define PG_dcache_dirty PG_arch_1
  17. #define flush_cache_dup_mm(mm) do {} while (0)
  18. #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
  19. #define flush_dcache_mmap_lock(mapping) do {} while (0)
  20. #define flush_dcache_mmap_unlock(mapping) do {} while (0)
  21. #define flush_cache_vmap(start, end) do {} while (0)
  22. #define flush_cache_vunmap(start, end) do {} while (0)
  23. static inline void flush_icache_page(struct vm_area_struct *vma,
  24. struct page *page)
  25. {
  26. if (vma->vm_flags & VM_EXEC) {
  27. void *v = page_address(page);
  28. flush_icache_range((unsigned long) v,
  29. (unsigned long) v + PAGE_SIZE);
  30. }
  31. }
  32. #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
  33. memcpy(dst, src, len)
  34. #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
  35. do { \
  36. memcpy(dst, src, len); \
  37. if ((vma->vm_flags & VM_EXEC)) \
  38. flush_cache_page(vma, vaddr, page_to_pfn(page));\
  39. } while (0)
  40. #endif /* _ASM_SCORE_CACHEFLUSH_H */