cacheflush.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #define flush_cache_dup_mm(mm) do {} while (0)
  16. #define flush_dcache_page(page) do {} while (0)
  17. #define flush_dcache_mmap_lock(mapping) do {} while (0)
  18. #define flush_dcache_mmap_unlock(mapping) do {} while (0)
  19. #define flush_cache_vmap(start, end) do {} while (0)
  20. #define flush_cache_vunmap(start, end) do {} while (0)
  21. static inline void flush_icache_page(struct vm_area_struct *vma,
  22. struct page *page)
  23. {
  24. if (vma->vm_flags & VM_EXEC) {
  25. void *v = page_address(page);
  26. flush_icache_range((unsigned long) v,
  27. (unsigned long) v + PAGE_SIZE);
  28. }
  29. }
  30. #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
  31. memcpy(dst, src, len)
  32. #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
  33. do { \
  34. memcpy(dst, src, len); \
  35. if ((vma->vm_flags & VM_EXEC)) \
  36. flush_cache_page(vma, vaddr, page_to_pfn(page));\
  37. } while (0)
  38. #endif /* _ASM_SCORE_CACHEFLUSH_H */