cacheflush_64.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef _SPARC64_CACHEFLUSH_H
  2. #define _SPARC64_CACHEFLUSH_H
  3. #include <asm/page.h>
  4. #ifndef __ASSEMBLY__
  5. #include <linux/mm.h>
  6. /* Cache flush operations. */
  7. /* These are the same regardless of whether this is an SMP kernel or not. */
  8. #define flush_cache_mm(__mm) \
  9. do { if ((__mm) == current->mm) flushw_user(); } while(0)
  10. #define flush_cache_dup_mm(mm) flush_cache_mm(mm)
  11. #define flush_cache_range(vma, start, end) \
  12. flush_cache_mm((vma)->vm_mm)
  13. #define flush_cache_page(vma, page, pfn) \
  14. flush_cache_mm((vma)->vm_mm)
  15. /*
  16. * On spitfire, the icache doesn't snoop local stores and we don't
  17. * use block commit stores (which invalidate icache lines) during
  18. * module load, so we need this.
  19. */
  20. extern void flush_icache_range(unsigned long start, unsigned long end);
  21. extern void __flush_icache_page(unsigned long);
  22. extern void __flush_dcache_page(void *addr, int flush_icache);
  23. extern void flush_dcache_page_impl(struct page *page);
  24. #ifdef CONFIG_SMP
  25. extern void smp_flush_dcache_page_impl(struct page *page, int cpu);
  26. extern void flush_dcache_page_all(struct mm_struct *mm, struct page *page);
  27. #else
  28. #define smp_flush_dcache_page_impl(page,cpu) flush_dcache_page_impl(page)
  29. #define flush_dcache_page_all(mm,page) flush_dcache_page_impl(page)
  30. #endif
  31. extern void __flush_dcache_range(unsigned long start, unsigned long end);
  32. extern void flush_dcache_page(struct page *page);
  33. #define flush_icache_page(vma, pg) do { } while(0)
  34. #define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
  35. extern void flush_ptrace_access(struct vm_area_struct *, struct page *,
  36. unsigned long uaddr, void *kaddr,
  37. unsigned long len, int write);
  38. #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
  39. do { \
  40. flush_cache_page(vma, vaddr, page_to_pfn(page)); \
  41. memcpy(dst, src, len); \
  42. flush_ptrace_access(vma, page, vaddr, src, len, 0); \
  43. } while (0)
  44. #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
  45. do { \
  46. flush_cache_page(vma, vaddr, page_to_pfn(page)); \
  47. memcpy(dst, src, len); \
  48. flush_ptrace_access(vma, page, vaddr, dst, len, 1); \
  49. } while (0)
  50. #define flush_dcache_mmap_lock(mapping) do { } while (0)
  51. #define flush_dcache_mmap_unlock(mapping) do { } while (0)
  52. #define flush_cache_vmap(start, end) do { } while (0)
  53. #define flush_cache_vunmap(start, end) do { } while (0)
  54. #ifdef CONFIG_DEBUG_PAGEALLOC
  55. /* internal debugging function */
  56. void kernel_map_pages(struct page *page, int numpages, int enable);
  57. #endif
  58. #endif /* !__ASSEMBLY__ */
  59. #endif /* _SPARC64_CACHEFLUSH_H */