cacheflush.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Port on Texas Instruments TMS320C6x architecture
  3. *
  4. * Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated
  5. * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef _ASM_C6X_CACHEFLUSH_H
  12. #define _ASM_C6X_CACHEFLUSH_H
  13. #include <linux/spinlock.h>
  14. #include <asm/setup.h>
  15. #include <asm/cache.h>
  16. #include <asm/mman.h>
  17. #include <asm/page.h>
  18. #include <asm/string.h>
  19. /*
  20. * virtually-indexed cache management (our cache is physically indexed)
  21. */
  22. #define flush_cache_all() do {} while (0)
  23. #define flush_cache_mm(mm) do {} while (0)
  24. #define flush_cache_dup_mm(mm) do {} while (0)
  25. #define flush_cache_range(mm, start, end) do {} while (0)
  26. #define flush_cache_page(vma, vmaddr, pfn) do {} while (0)
  27. #define flush_cache_vmap(start, end) do {} while (0)
  28. #define flush_cache_vunmap(start, end) do {} while (0)
  29. #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
  30. #define flush_dcache_page(page) do {} while (0)
  31. #define flush_dcache_mmap_lock(mapping) do {} while (0)
  32. #define flush_dcache_mmap_unlock(mapping) do {} while (0)
  33. /*
  34. * physically-indexed cache management
  35. */
  36. #define flush_icache_range(s, e) \
  37. do { \
  38. L1D_cache_block_writeback((s), (e)); \
  39. L1P_cache_block_invalidate((s), (e)); \
  40. } while (0)
  41. #define flush_icache_page(vma, page) \
  42. do { \
  43. if ((vma)->vm_flags & PROT_EXEC) \
  44. L1D_cache_block_writeback_invalidate(page_address(page), \
  45. (unsigned long) page_address(page) + PAGE_SIZE)); \
  46. L1P_cache_block_invalidate(page_address(page), \
  47. (unsigned long) page_address(page) + PAGE_SIZE)); \
  48. } while (0)
  49. #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
  50. do { \
  51. memcpy(dst, src, len); \
  52. flush_icache_range((unsigned) (dst), (unsigned) (dst) + (len)); \
  53. } while (0)
  54. #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
  55. memcpy(dst, src, len)
  56. #endif /* _ASM_C6X_CACHEFLUSH_H */