cacheflush_64.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. #define flushw_all() __asm__ __volatile__("flushw")
  8. void __flushw_user(void);
  9. #define flushw_user() __flushw_user()
  10. #define flush_user_windows flushw_user
  11. #define flush_register_windows flushw_all
  12. /* These are the same regardless of whether this is an SMP kernel or not. */
  13. #define flush_cache_mm(__mm) \
  14. do { if ((__mm) == current->mm) flushw_user(); } while(0)
  15. #define flush_cache_dup_mm(mm) flush_cache_mm(mm)
  16. #define flush_cache_range(vma, start, end) \
  17. flush_cache_mm((vma)->vm_mm)
  18. #define flush_cache_page(vma, page, pfn) \
  19. flush_cache_mm((vma)->vm_mm)
  20. /*
  21. * On spitfire, the icache doesn't snoop local stores and we don't
  22. * use block commit stores (which invalidate icache lines) during
  23. * module load, so we need this.
  24. */
  25. void flush_icache_range(unsigned long start, unsigned long end);
  26. void __flush_icache_page(unsigned long);
  27. void __flush_dcache_page(void *addr, int flush_icache);
  28. void flush_dcache_page_impl(struct page *page);
  29. #ifdef CONFIG_SMP
  30. void smp_flush_dcache_page_impl(struct page *page, int cpu);
  31. void flush_dcache_page_all(struct mm_struct *mm, struct page *page);
  32. #else
  33. #define smp_flush_dcache_page_impl(page,cpu) flush_dcache_page_impl(page)
  34. #define flush_dcache_page_all(mm,page) flush_dcache_page_impl(page)
  35. #endif
  36. void __flush_dcache_range(unsigned long start, unsigned long end);
  37. #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
  38. void flush_dcache_page(struct page *page);
  39. #define flush_icache_page(vma, pg) do { } while(0)
  40. #define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
  41. void flush_ptrace_access(struct vm_area_struct *, struct page *,
  42. unsigned long uaddr, void *kaddr,
  43. unsigned long len, int write);
  44. #define copy_to_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, src, len, 0); \
  49. } while (0)
  50. #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
  51. do { \
  52. flush_cache_page(vma, vaddr, page_to_pfn(page)); \
  53. memcpy(dst, src, len); \
  54. flush_ptrace_access(vma, page, vaddr, dst, len, 1); \
  55. } while (0)
  56. #define flush_dcache_mmap_lock(mapping) do { } while (0)
  57. #define flush_dcache_mmap_unlock(mapping) do { } while (0)
  58. #define flush_cache_vmap(start, end) do { } while (0)
  59. #define flush_cache_vunmap(start, end) do { } while (0)
  60. #endif /* !__ASSEMBLY__ */
  61. #endif /* _SPARC64_CACHEFLUSH_H */