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-v4wb.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-v4wb.c')
-rw-r--r-- | arch/arm/mm/copypage-v4wb.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/arch/arm/mm/copypage-v4wb.c b/arch/arm/mm/copypage-v4wb.c index 186a68a794a9..9144a96037bf 100644 --- a/arch/arm/mm/copypage-v4wb.c +++ b/arch/arm/mm/copypage-v4wb.c | |||
@@ -64,31 +64,31 @@ void v4wb_copy_user_highpage(struct page *to, struct page *from, | |||
64 | * | 64 | * |
65 | * Same story as above. | 65 | * Same story as above. |
66 | */ | 66 | */ |
67 | void __attribute__((naked)) | 67 | void v4wb_clear_user_highpage(struct page *page, unsigned long vaddr) |
68 | v4wb_clear_user_page(void *kaddr, unsigned long vaddr) | ||
69 | { | 68 | { |
69 | void *kaddr = kmap_atomic(page, KM_USER0); | ||
70 | asm("\ | 70 | asm("\ |
71 | str lr, [sp, #-4]!\n\ | 71 | mov r1, %1 @ 1\n\ |
72 | mov r1, %0 @ 1\n\ | ||
73 | mov r2, #0 @ 1\n\ | 72 | mov r2, #0 @ 1\n\ |
74 | mov r3, #0 @ 1\n\ | 73 | mov r3, #0 @ 1\n\ |
75 | mov ip, #0 @ 1\n\ | 74 | mov ip, #0 @ 1\n\ |
76 | mov lr, #0 @ 1\n\ | 75 | mov lr, #0 @ 1\n\ |
77 | 1: mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line\n\ | 76 | 1: mcr p15, 0, %0, c7, c6, 1 @ 1 invalidate D line\n\ |
78 | stmia r0!, {r2, r3, ip, lr} @ 4\n\ | 77 | stmia %0!, {r2, r3, ip, lr} @ 4\n\ |
79 | stmia r0!, {r2, r3, ip, lr} @ 4\n\ | 78 | stmia %0!, {r2, r3, ip, lr} @ 4\n\ |
80 | mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line\n\ | 79 | mcr p15, 0, %0, c7, c6, 1 @ 1 invalidate D line\n\ |
81 | stmia r0!, {r2, r3, ip, lr} @ 4\n\ | 80 | stmia %0!, {r2, r3, ip, lr} @ 4\n\ |
82 | stmia r0!, {r2, r3, ip, lr} @ 4\n\ | 81 | stmia %0!, {r2, r3, ip, lr} @ 4\n\ |
83 | subs r1, r1, #1 @ 1\n\ | 82 | subs r1, r1, #1 @ 1\n\ |
84 | bne 1b @ 1\n\ | 83 | bne 1b @ 1\n\ |
85 | mcr p15, 0, r1, c7, c10, 4 @ 1 drain WB\n\ | 84 | mcr p15, 0, r1, c7, c10, 4 @ 1 drain WB" |
86 | ldr pc, [sp], #4" | ||
87 | : | 85 | : |
88 | : "I" (PAGE_SIZE / 64)); | 86 | : "r" (kaddr), "I" (PAGE_SIZE / 64) |
87 | : "r1", "r2", "r3", "ip", "lr"); | ||
88 | kunmap_atomic(kaddr, KM_USER0); | ||
89 | } | 89 | } |
90 | 90 | ||
91 | struct cpu_user_fns v4wb_user_fns __initdata = { | 91 | struct cpu_user_fns v4wb_user_fns __initdata = { |
92 | .cpu_clear_user_page = v4wb_clear_user_page, | 92 | .cpu_clear_user_highpage = v4wb_clear_user_highpage, |
93 | .cpu_copy_user_highpage = v4wb_copy_user_highpage, | 93 | .cpu_copy_user_highpage = v4wb_copy_user_highpage, |
94 | }; | 94 | }; |