diff options
Diffstat (limited to 'include/asm-mips/cacheflush.h')
-rw-r--r-- | include/asm-mips/cacheflush.h | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h index 3711d720aeb4..4213d2c8bb8a 100644 --- a/include/asm-mips/cacheflush.h +++ b/include/asm-mips/cacheflush.h | |||
@@ -54,19 +54,24 @@ extern void (*flush_icache_range)(unsigned long __user start, | |||
54 | #define flush_cache_vmap(start, end) flush_cache_all() | 54 | #define flush_cache_vmap(start, end) flush_cache_all() |
55 | #define flush_cache_vunmap(start, end) flush_cache_all() | 55 | #define flush_cache_vunmap(start, end) flush_cache_all() |
56 | 56 | ||
57 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ | 57 | static inline void copy_to_user_page(struct vm_area_struct *vma, |
58 | do { \ | 58 | struct page *page, unsigned long vaddr, void *dst, const void *src, |
59 | if (cpu_has_dc_aliases) \ | 59 | unsigned long len) |
60 | flush_cache_page(vma, vaddr); \ | 60 | { |
61 | memcpy(dst, (void *) src, len); \ | 61 | if (cpu_has_dc_aliases) |
62 | flush_icache_page(vma, page); \ | 62 | flush_cache_page(vma, vaddr, page_to_pfn(page)); |
63 | } while (0) | 63 | memcpy(dst, src, len); |
64 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ | 64 | flush_icache_page(vma, page); |
65 | do { \ | 65 | } |
66 | if (cpu_has_dc_aliases) \ | 66 | |
67 | flush_cache_page(vma, vaddr); \ | 67 | static inline void copy_from_user_page(struct vm_area_struct *vma, |
68 | memcpy(dst, src, len); \ | 68 | struct page *page, unsigned long vaddr, void *dst, const void *src, |
69 | } while (0) | 69 | unsigned long len) |
70 | { | ||
71 | if (cpu_has_dc_aliases) | ||
72 | flush_cache_page(vma, vaddr, page_to_pfn(page)); | ||
73 | memcpy(dst, src, len); | ||
74 | } | ||
70 | 75 | ||
71 | extern void (*flush_cache_sigtramp)(unsigned long addr); | 76 | extern void (*flush_cache_sigtramp)(unsigned long addr); |
72 | extern void (*flush_icache_all)(void); | 77 | extern void (*flush_icache_all)(void); |