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