diff options
-rw-r--r-- | arch/sh/mm/pg-sh4.c | 23 | ||||
-rw-r--r-- | include/asm-sh/page.h | 6 |
2 files changed, 29 insertions, 0 deletions
diff --git a/arch/sh/mm/pg-sh4.c b/arch/sh/mm/pg-sh4.c index 25f5c6f6821d..ede6dd1e3701 100644 --- a/arch/sh/mm/pg-sh4.c +++ b/arch/sh/mm/pg-sh4.c | |||
@@ -9,6 +9,8 @@ | |||
9 | #include <linux/mm.h> | 9 | #include <linux/mm.h> |
10 | #include <linux/mutex.h> | 10 | #include <linux/mutex.h> |
11 | #include <linux/fs.h> | 11 | #include <linux/fs.h> |
12 | #include <linux/highmem.h> | ||
13 | #include <linux/module.h> | ||
12 | #include <asm/mmu_context.h> | 14 | #include <asm/mmu_context.h> |
13 | #include <asm/cacheflush.h> | 15 | #include <asm/cacheflush.h> |
14 | 16 | ||
@@ -79,6 +81,27 @@ void copy_user_page(void *to, void *from, unsigned long address, | |||
79 | } | 81 | } |
80 | } | 82 | } |
81 | 83 | ||
84 | void copy_user_highpage(struct page *to, struct page *from, | ||
85 | unsigned long vaddr, struct vm_area_struct *vma) | ||
86 | { | ||
87 | void *vfrom, *vto; | ||
88 | |||
89 | __set_bit(PG_mapped, &to->flags); | ||
90 | |||
91 | vto = kmap_atomic(to, KM_USER1); | ||
92 | vfrom = kmap_coherent(from, vaddr); | ||
93 | copy_page(vto, vfrom); | ||
94 | kunmap_coherent(vfrom); | ||
95 | |||
96 | if (((vaddr ^ (unsigned long)vto) & CACHE_ALIAS)) | ||
97 | __flush_wback_region(vto, PAGE_SIZE); | ||
98 | |||
99 | kunmap_atomic(vto, KM_USER1); | ||
100 | /* Make sure this page is cleared on other CPU's too before using it */ | ||
101 | smp_wmb(); | ||
102 | } | ||
103 | EXPORT_SYMBOL(copy_user_highpage); | ||
104 | |||
82 | /* | 105 | /* |
83 | * For SH-4, we have our own implementation for ptep_get_and_clear | 106 | * For SH-4, we have our own implementation for ptep_get_and_clear |
84 | */ | 107 | */ |
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h index 3aa8b07da47d..5e69de1eacdf 100644 --- a/include/asm-sh/page.h +++ b/include/asm-sh/page.h | |||
@@ -73,10 +73,16 @@ extern void copy_page_nommu(void *to, void *from); | |||
73 | #if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_MMU) && \ | 73 | #if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_MMU) && \ |
74 | (defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB)) | 74 | (defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB)) |
75 | struct page; | 75 | struct page; |
76 | struct vm_area_struct; | ||
76 | extern void clear_user_page(void *to, unsigned long address, struct page *pg); | 77 | extern void clear_user_page(void *to, unsigned long address, struct page *pg); |
77 | extern void copy_user_page(void *to, void *from, unsigned long address, struct page *pg); | 78 | extern void copy_user_page(void *to, void *from, unsigned long address, struct page *pg); |
78 | extern void __clear_user_page(void *to, void *orig_to); | 79 | extern void __clear_user_page(void *to, void *orig_to); |
79 | extern void __copy_user_page(void *to, void *from, void *orig_to); | 80 | extern void __copy_user_page(void *to, void *from, void *orig_to); |
81 | #ifdef CONFIG_CPU_SH4 | ||
82 | extern void copy_user_highpage(struct page *to, struct page *from, | ||
83 | unsigned long vaddr, struct vm_area_struct *vma); | ||
84 | #define __HAVE_ARCH_COPY_USER_HIGHPAGE | ||
85 | #endif | ||
80 | #else | 86 | #else |
81 | #define clear_user_page(page, vaddr, pg) clear_page(page) | 87 | #define clear_user_page(page, vaddr, pg) clear_page(page) |
82 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) | 88 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) |