aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/copypage-feroceon.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-10-31 11:08:35 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-11-27 18:53:47 -0500
commit063b0a4207e43acbeff3d4b09f43e750e0212b48 (patch)
treeeb2a2c1faa732c763102040478830111fc13f2a5 /arch/arm/mm/copypage-feroceon.c
parentd73e60b7144a86baf0fdfcc9537a70bb4f72e11c (diff)
[ARM] copypage: provide our own copy_user_highpage()
We used to override the copy_user_page() function. However, this is not only inefficient, it also causes additional complexity for highmem support, since we convert from a struct page to a kernel direct mapped address and back to a struct page again. Moreover, with highmem support, we end up pointlessly setting up kmap entries for pages which we're going to remap. So, push the kmapping down into the copypage implementation files where it's required. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/copypage-feroceon.c')
-rw-r--r--arch/arm/mm/copypage-feroceon.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/arch/arm/mm/copypage-feroceon.c b/arch/arm/mm/copypage-feroceon.c
index c8347670ab00..edd71686b8df 100644
--- a/arch/arm/mm/copypage-feroceon.c
+++ b/arch/arm/mm/copypage-feroceon.c
@@ -7,15 +7,14 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 * This handles copy_user_page and clear_user_page on Feroceon 10 * This handles copy_user_highpage and clear_user_page on Feroceon
11 * more optimally than the generic implementations. 11 * more optimally than the generic implementations.
12 */ 12 */
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/highmem.h>
14 15
15#include <asm/page.h> 16static void __attribute__((naked))
16 17feroceon_copy_user_page(void *kto, const void *kfrom)
17void __attribute__((naked))
18feroceon_copy_user_page(void *kto, const void *kfrom, unsigned long vaddr)
19{ 18{
20 asm("\ 19 asm("\
21 stmfd sp!, {r4-r9, lr} \n\ 20 stmfd sp!, {r4-r9, lr} \n\
@@ -68,6 +67,18 @@ feroceon_copy_user_page(void *kto, const void *kfrom, unsigned long vaddr)
68 : "I" (PAGE_SIZE)); 67 : "I" (PAGE_SIZE));
69} 68}
70 69
70void feroceon_copy_user_highpage(struct page *to, struct page *from,
71 unsigned long vaddr)
72{
73 void *kto, *kfrom;
74
75 kto = kmap_atomic(to, KM_USER0);
76 kfrom = kmap_atomic(from, KM_USER1);
77 feroceon_copy_user_page(kto, kfrom);
78 kunmap_atomic(kfrom, KM_USER1);
79 kunmap_atomic(kto, KM_USER0);
80}
81
71void __attribute__((naked)) 82void __attribute__((naked))
72feroceon_clear_user_page(void *kaddr, unsigned long vaddr) 83feroceon_clear_user_page(void *kaddr, unsigned long vaddr)
73{ 84{
@@ -95,6 +106,6 @@ feroceon_clear_user_page(void *kaddr, unsigned long vaddr)
95 106
96struct cpu_user_fns feroceon_user_fns __initdata = { 107struct cpu_user_fns feroceon_user_fns __initdata = {
97 .cpu_clear_user_page = feroceon_clear_user_page, 108 .cpu_clear_user_page = feroceon_clear_user_page,
98 .cpu_copy_user_page = feroceon_copy_user_page, 109 .cpu_copy_user_highpage = feroceon_copy_user_highpage,
99}; 110};
100 111