cacheflush.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * include/asm-v850/cacheflush.h
  3. *
  4. * Copyright (C) 2001,02,03 NEC Electronics Corporation
  5. * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org>
  6. *
  7. * This file is subject to the terms and conditions of the GNU General
  8. * Public License. See the file COPYING in the main directory of this
  9. * archive for more details.
  10. *
  11. * Written by Miles Bader <miles@gnu.org>
  12. */
  13. #ifndef __V850_CACHEFLUSH_H__
  14. #define __V850_CACHEFLUSH_H__
  15. /* Somebody depends on this; sigh... */
  16. #include <linux/mm.h>
  17. #include <asm/machdep.h>
  18. /* The following are all used by the kernel in ways that only affect
  19. systems with MMUs, so we don't need them. */
  20. #define flush_cache_all() ((void)0)
  21. #define flush_cache_mm(mm) ((void)0)
  22. #define flush_cache_range(vma, start, end) ((void)0)
  23. #define flush_cache_page(vma, vmaddr, pfn) ((void)0)
  24. #define flush_dcache_page(page) ((void)0)
  25. #define flush_dcache_mmap_lock(mapping) ((void)0)
  26. #define flush_dcache_mmap_unlock(mapping) ((void)0)
  27. #define flush_cache_vmap(start, end) ((void)0)
  28. #define flush_cache_vunmap(start, end) ((void)0)
  29. #ifdef CONFIG_NO_CACHE
  30. /* Some systems have no cache at all, in which case we don't need these
  31. either. */
  32. #define flush_icache() ((void)0)
  33. #define flush_icache_range(start, end) ((void)0)
  34. #define flush_icache_page(vma,pg) ((void)0)
  35. #define flush_icache_user_range(vma,pg,adr,len) ((void)0)
  36. #define flush_cache_sigtramp(vaddr) ((void)0)
  37. #else /* !CONFIG_NO_CACHE */
  38. struct page;
  39. struct mm_struct;
  40. struct vm_area_struct;
  41. /* Otherwise, somebody had better define them. */
  42. extern void flush_icache (void);
  43. extern void flush_icache_range (unsigned long start, unsigned long end);
  44. extern void flush_icache_page (struct vm_area_struct *vma, struct page *page);
  45. extern void flush_icache_user_range (struct vm_area_struct *vma,
  46. struct page *page,
  47. unsigned long adr, int len);
  48. extern void flush_cache_sigtramp (unsigned long addr);
  49. #endif /* CONFIG_NO_CACHE */
  50. #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
  51. do { memcpy(dst, src, len); \
  52. flush_icache_user_range(vma, page, vaddr, len); \
  53. } while (0)
  54. #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
  55. memcpy(dst, src, len)
  56. #endif /* __V850_CACHEFLUSH_H__ */