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-v4mc.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-v4mc.c')
-rw-r--r-- | arch/arm/mm/copypage-v4mc.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/arch/arm/mm/copypage-v4mc.c b/arch/arm/mm/copypage-v4mc.c index a7dc838fee76..a5eae503a34f 100644 --- a/arch/arm/mm/copypage-v4mc.c +++ b/arch/arm/mm/copypage-v4mc.c | |||
@@ -91,30 +91,30 @@ void v4_mc_copy_user_highpage(struct page *from, struct page *to, | |||
91 | /* | 91 | /* |
92 | * ARMv4 optimised clear_user_page | 92 | * ARMv4 optimised clear_user_page |
93 | */ | 93 | */ |
94 | void __attribute__((naked)) | 94 | void v4_mc_clear_user_highpage(struct page *page, unsigned long vaddr) |
95 | v4_mc_clear_user_page(void *kaddr, unsigned long vaddr) | ||
96 | { | 95 | { |
97 | asm volatile( | 96 | void *kaddr = kmap_atomic(page, KM_USER0); |
98 | "str lr, [sp, #-4]!\n\ | 97 | asm volatile("\ |
99 | mov r1, %0 @ 1\n\ | 98 | mov r1, %0 @ 1\n\ |
100 | mov r2, #0 @ 1\n\ | 99 | mov r2, #0 @ 1\n\ |
101 | mov r3, #0 @ 1\n\ | 100 | mov r3, #0 @ 1\n\ |
102 | mov ip, #0 @ 1\n\ | 101 | mov ip, #0 @ 1\n\ |
103 | mov lr, #0 @ 1\n\ | 102 | mov lr, #0 @ 1\n\ |
104 | 1: mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line\n\ | 103 | 1: mcr p15, 0, %0, c7, c6, 1 @ 1 invalidate D line\n\ |
105 | stmia r0!, {r2, r3, ip, lr} @ 4\n\ | 104 | stmia %0!, {r2, r3, ip, lr} @ 4\n\ |
106 | stmia r0!, {r2, r3, ip, lr} @ 4\n\ | 105 | stmia %0!, {r2, r3, ip, lr} @ 4\n\ |
107 | mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line\n\ | 106 | mcr p15, 0, %0, c7, c6, 1 @ 1 invalidate D line\n\ |
108 | stmia r0!, {r2, r3, ip, lr} @ 4\n\ | 107 | stmia %0!, {r2, r3, ip, lr} @ 4\n\ |
109 | stmia r0!, {r2, r3, ip, lr} @ 4\n\ | 108 | stmia %0!, {r2, r3, ip, lr} @ 4\n\ |
110 | subs r1, r1, #1 @ 1\n\ | 109 | subs r1, r1, #1 @ 1\n\ |
111 | bne 1b @ 1\n\ | 110 | bne 1b @ 1" |
112 | ldr pc, [sp], #4" | ||
113 | : | 111 | : |
114 | : "I" (PAGE_SIZE / 64)); | 112 | : "r" (kaddr), "I" (PAGE_SIZE / 64) |
113 | : "r1", "r2", "r3", "ip", "lr"); | ||
114 | kunmap_atomic(kaddr, KM_USER0); | ||
115 | } | 115 | } |
116 | 116 | ||
117 | struct cpu_user_fns v4_mc_user_fns __initdata = { | 117 | struct cpu_user_fns v4_mc_user_fns __initdata = { |
118 | .cpu_clear_user_page = v4_mc_clear_user_page, | 118 | .cpu_clear_user_highpage = v4_mc_clear_user_highpage, |
119 | .cpu_copy_user_highpage = v4_mc_copy_user_highpage, | 119 | .cpu_copy_user_highpage = v4_mc_copy_user_highpage, |
120 | }; | 120 | }; |