411ebdbf9ced5969ee308c83964785caefc5fe21
[openwrt/svn-archive/archive.git] / target / linux / brcm47xx / patches-2.6.23 / 310-no_highpage.patch
1 --- a/arch/mips/mm/init.c
2 +++ b/arch/mips/mm/init.c
3 @@ -205,31 +205,6 @@
4 preempt_check_resched();
5 }
6
7 -void copy_user_highpage(struct page *to, struct page *from,
8 - unsigned long vaddr, struct vm_area_struct *vma)
9 -{
10 - void *vfrom, *vto;
11 -
12 - vto = kmap_atomic(to, KM_USER1);
13 - if (cpu_has_dc_aliases && cpu_use_kmap_coherent && !Page_dcache_dirty(from)) {
14 - vfrom = kmap_coherent(from, vaddr);
15 - copy_page(vto, vfrom);
16 - kunmap_coherent();
17 - } else {
18 - vfrom = kmap_atomic(from, KM_USER0);
19 - copy_page(vto, vfrom);
20 - kunmap_atomic(vfrom, KM_USER0);
21 - }
22 - if (((vma->vm_flags & VM_EXEC) && !cpu_has_ic_fills_f_dc) ||
23 - pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK))
24 - flush_data_cache_page((unsigned long)vto);
25 - kunmap_atomic(vto, KM_USER1);
26 - /* Make sure this page is cleared on other CPU's too before using it */
27 - smp_wmb();
28 -}
29 -
30 -EXPORT_SYMBOL(copy_user_highpage);
31 -
32 void copy_to_user_page(struct vm_area_struct *vma,
33 struct page *page, unsigned long vaddr, void *dst, const void *src,
34 unsigned long len)
35 --- a/include/asm-mips/page.h
36 +++ b/include/asm-mips/page.h
37 @@ -35,6 +35,7 @@
38 #ifndef __ASSEMBLY__
39
40 #include <linux/pfn.h>
41 +#include <asm/cpu-features.h>
42 #include <asm/io.h>
43
44 /*
45 @@ -67,13 +68,16 @@
46 flush_data_cache_page((unsigned long)addr);
47 }
48
49 -extern void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
50 - struct page *to);
51 -struct vm_area_struct;
52 -extern void copy_user_highpage(struct page *to, struct page *from,
53 - unsigned long vaddr, struct vm_area_struct *vma);
54 +static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
55 + struct page *to)
56 +{
57 + extern void (*flush_data_cache_page)(unsigned long addr);
58
59 -#define __HAVE_ARCH_COPY_USER_HIGHPAGE
60 + copy_page(vto, vfrom);
61 + if (!cpu_has_ic_fills_f_dc ||
62 + pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK))
63 + flush_data_cache_page((unsigned long)vto);
64 +}
65
66 /*
67 * These are used to make use of C type-checking..