diff options
-rw-r--r-- | arch/mips/mm/init.c | 25 | ||||
-rw-r--r-- | include/asm-mips/page.h | 16 |
2 files changed, 31 insertions, 10 deletions
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index ea2d15370bb7..30245c09d025 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c | |||
@@ -203,6 +203,31 @@ static inline void kunmap_coherent(struct page *page) | |||
203 | preempt_check_resched(); | 203 | preempt_check_resched(); |
204 | } | 204 | } |
205 | 205 | ||
206 | void copy_user_highpage(struct page *to, struct page *from, | ||
207 | unsigned long vaddr, struct vm_area_struct *vma) | ||
208 | { | ||
209 | void *vfrom, *vto; | ||
210 | |||
211 | vto = kmap_atomic(to, KM_USER1); | ||
212 | if (cpu_has_dc_aliases) { | ||
213 | vfrom = kmap_coherent(from, vaddr); | ||
214 | copy_page(vto, vfrom); | ||
215 | kunmap_coherent(from); | ||
216 | } else { | ||
217 | vfrom = kmap_atomic(from, KM_USER0); | ||
218 | copy_page(vto, vfrom); | ||
219 | kunmap_atomic(vfrom, KM_USER0); | ||
220 | } | ||
221 | if (((vma->vm_flags & VM_EXEC) && !cpu_has_ic_fills_f_dc) || | ||
222 | pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK)) | ||
223 | flush_data_cache_page((unsigned long)vto); | ||
224 | kunmap_atomic(vto, KM_USER1); | ||
225 | /* Make sure this page is cleared on other CPU's too before using it */ | ||
226 | smp_wmb(); | ||
227 | } | ||
228 | |||
229 | EXPORT_SYMBOL(copy_user_highpage); | ||
230 | |||
206 | void copy_to_user_page(struct vm_area_struct *vma, | 231 | void copy_to_user_page(struct vm_area_struct *vma, |
207 | struct page *page, unsigned long vaddr, void *dst, const void *src, | 232 | struct page *page, unsigned long vaddr, void *dst, const void *src, |
208 | unsigned long len) | 233 | unsigned long len) |
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index 0dc1a45c27ed..2f9e1a9ec51f 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h | |||
@@ -35,7 +35,6 @@ | |||
35 | #ifndef __ASSEMBLY__ | 35 | #ifndef __ASSEMBLY__ |
36 | 36 | ||
37 | #include <linux/pfn.h> | 37 | #include <linux/pfn.h> |
38 | #include <asm/cpu-features.h> | ||
39 | #include <asm/io.h> | 38 | #include <asm/io.h> |
40 | 39 | ||
41 | extern void clear_page(void * page); | 40 | extern void clear_page(void * page); |
@@ -61,16 +60,13 @@ static inline void clear_user_page(void *addr, unsigned long vaddr, | |||
61 | flush_data_cache_page((unsigned long)addr); | 60 | flush_data_cache_page((unsigned long)addr); |
62 | } | 61 | } |
63 | 62 | ||
64 | static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, | 63 | extern void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, |
65 | struct page *to) | 64 | struct page *to); |
66 | { | 65 | struct vm_area_struct; |
67 | extern void (*flush_data_cache_page)(unsigned long addr); | 66 | extern void copy_user_highpage(struct page *to, struct page *from, |
67 | unsigned long vaddr, struct vm_area_struct *vma); | ||
68 | 68 | ||
69 | copy_page(vto, vfrom); | 69 | #define __HAVE_ARCH_COPY_USER_HIGHPAGE |
70 | if (!cpu_has_ic_fills_f_dc || | ||
71 | pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK)) | ||
72 | flush_data_cache_page((unsigned long)vto); | ||
73 | } | ||
74 | 70 | ||
75 | /* | 71 | /* |
76 | * These are used to make use of C type-checking.. | 72 | * These are used to make use of C type-checking.. |