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