diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-10-31 12:32:19 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-11-27 18:53:48 -0500 |
commit | 303c6443659bc1dc911356f5de149f48ff1d97b8 (patch) | |
tree | 75da0aef28ec8e843cdeb24c96349bdf812e2740 /arch/arm/mm/copypage-xscale.c | |
parent | 063b0a4207e43acbeff3d4b09f43e750e0212b48 (diff) |
[ARM] clearpage: provide our own clear_user_highpage()
For similar reasons as copy_user_page(), we want to avoid the
additional kmap_atomic if it's unnecessary.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/copypage-xscale.c')
-rw-r--r-- | arch/arm/mm/copypage-xscale.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/arch/arm/mm/copypage-xscale.c b/arch/arm/mm/copypage-xscale.c index 01bafafce181..aa9f2ff9dce0 100644 --- a/arch/arm/mm/copypage-xscale.c +++ b/arch/arm/mm/copypage-xscale.c | |||
@@ -113,28 +113,30 @@ void xscale_mc_copy_user_highpage(struct page *to, struct page *from, | |||
113 | /* | 113 | /* |
114 | * XScale optimised clear_user_page | 114 | * XScale optimised clear_user_page |
115 | */ | 115 | */ |
116 | void __attribute__((naked)) | 116 | void |
117 | xscale_mc_clear_user_page(void *kaddr, unsigned long vaddr) | 117 | xscale_mc_clear_user_highpage(struct page *page, unsigned long vaddr) |
118 | { | 118 | { |
119 | void *kaddr = kmap_atomic(page, KM_USER0); | ||
119 | asm volatile( | 120 | asm volatile( |
120 | "mov r1, %0 \n\ | 121 | "mov r1, %1 \n\ |
121 | mov r2, #0 \n\ | 122 | mov r2, #0 \n\ |
122 | mov r3, #0 \n\ | 123 | mov r3, #0 \n\ |
123 | 1: mov ip, r0 \n\ | 124 | 1: mov ip, %0 \n\ |
124 | strd r2, [r0], #8 \n\ | 125 | strd r2, [%0], #8 \n\ |
125 | strd r2, [r0], #8 \n\ | 126 | strd r2, [%0], #8 \n\ |
126 | strd r2, [r0], #8 \n\ | 127 | strd r2, [%0], #8 \n\ |
127 | strd r2, [r0], #8 \n\ | 128 | strd r2, [%0], #8 \n\ |
128 | mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\ | 129 | mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\ |
129 | subs r1, r1, #1 \n\ | 130 | subs r1, r1, #1 \n\ |
130 | mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\ | 131 | mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\ |
131 | bne 1b \n\ | 132 | bne 1b" |
132 | mov pc, lr" | ||
133 | : | 133 | : |
134 | : "I" (PAGE_SIZE / 32)); | 134 | : "r" (kaddr), "I" (PAGE_SIZE / 32) |
135 | : "r1", "r2", "r3", "ip"); | ||
136 | kunmap_atomic(kaddr, KM_USER0); | ||
135 | } | 137 | } |
136 | 138 | ||
137 | struct cpu_user_fns xscale_mc_user_fns __initdata = { | 139 | struct cpu_user_fns xscale_mc_user_fns __initdata = { |
138 | .cpu_clear_user_page = xscale_mc_clear_user_page, | 140 | .cpu_clear_user_highpage = xscale_mc_clear_user_highpage, |
139 | .cpu_copy_user_highpage = xscale_mc_copy_user_highpage, | 141 | .cpu_copy_user_highpage = xscale_mc_copy_user_highpage, |
140 | }; | 142 | }; |