diff options
Diffstat (limited to 'include/asm-mips/cacheflush.h')
-rw-r--r-- | include/asm-mips/cacheflush.h | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h index 635f1bfb403e..a18ba2edc0b6 100644 --- a/include/asm-mips/cacheflush.h +++ b/include/asm-mips/cacheflush.h | |||
@@ -49,17 +49,29 @@ static inline void flush_dcache_page(struct page *page) | |||
49 | 49 | ||
50 | extern void (*flush_icache_page)(struct vm_area_struct *vma, | 50 | extern void (*flush_icache_page)(struct vm_area_struct *vma, |
51 | struct page *page); | 51 | struct page *page); |
52 | extern void (*flush_icache_range)(unsigned long start, unsigned long end); | 52 | extern void (*flush_icache_range)(unsigned long __user start, |
53 | unsigned long __user end); | ||
53 | #define flush_cache_vmap(start, end) flush_cache_all() | 54 | #define flush_cache_vmap(start, end) flush_cache_all() |
54 | #define flush_cache_vunmap(start, end) flush_cache_all() | 55 | #define flush_cache_vunmap(start, end) flush_cache_all() |
55 | 56 | ||
56 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ | 57 | static inline void copy_to_user_page(struct vm_area_struct *vma, |
57 | do { \ | 58 | struct page *page, unsigned long vaddr, void *dst, const void *src, |
58 | memcpy(dst, (void *) src, len); \ | 59 | unsigned long len) |
59 | flush_icache_page(vma, page); \ | 60 | { |
60 | } while (0) | 61 | if (cpu_has_dc_aliases) |
61 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ | 62 | flush_cache_page(vma, vaddr, page_to_pfn(page)); |
62 | memcpy(dst, src, len) | 63 | memcpy(dst, src, len); |
64 | flush_icache_page(vma, page); | ||
65 | } | ||
66 | |||
67 | static inline void copy_from_user_page(struct vm_area_struct *vma, | ||
68 | struct page *page, unsigned long vaddr, void *dst, const void *src, | ||
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 | } | ||
63 | 75 | ||
64 | extern void (*flush_cache_sigtramp)(unsigned long addr); | 76 | extern void (*flush_cache_sigtramp)(unsigned long addr); |
65 | extern void (*flush_icache_all)(void); | 77 | extern void (*flush_icache_all)(void); |
@@ -78,4 +90,7 @@ extern void (*flush_data_cache_page)(unsigned long addr); | |||
78 | #define ClearPageDcacheDirty(page) \ | 90 | #define ClearPageDcacheDirty(page) \ |
79 | clear_bit(PG_dcache_dirty, &(page)->flags) | 91 | clear_bit(PG_dcache_dirty, &(page)->flags) |
80 | 92 | ||
93 | /* Run kernel code uncached, useful for cache probing functions. */ | ||
94 | unsigned long __init run_uncached(void *func); | ||
95 | |||
81 | #endif /* _ASM_CACHEFLUSH_H */ | 96 | #endif /* _ASM_CACHEFLUSH_H */ |