aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/copypage-v3.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-10-31 09:08:02 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-11-27 18:53:46 -0500
commitd73e60b7144a86baf0fdfcc9537a70bb4f72e11c (patch)
tree02155154caf6f1a5d6ce38f2a89ed67f875c7791 /arch/arm/mm/copypage-v3.c
parent487ff32082a9bd7489d8185cf7d7a2fdf18a22fa (diff)
[ARM] copypage: convert assembly files to C
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/copypage-v3.c')
-rw-r--r--arch/arm/mm/copypage-v3.c69
1 files changed, 69 insertions, 0 deletions
diff --git a/arch/arm/mm/copypage-v3.c b/arch/arm/mm/copypage-v3.c
new file mode 100644
index 000000000000..184911089e6c
--- /dev/null
+++ b/arch/arm/mm/copypage-v3.c
@@ -0,0 +1,69 @@
1/*
2 * linux/arch/arm/mm/copypage-v3.c
3 *
4 * Copyright (C) 1995-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/init.h>
11
12#include <asm/page.h>
13
14/*
15 * ARMv3 optimised copy_user_page
16 *
17 * FIXME: do we need to handle cache stuff...
18 */
19void __attribute__((naked))
20v3_copy_user_page(void *kto, const void *kfrom, unsigned long vaddr)
21{
22 asm("\n\
23 stmfd sp!, {r4, lr} @ 2\n\
24 mov r2, %2 @ 1\n\
25 ldmia %0!, {r3, r4, ip, lr} @ 4+1\n\
261: stmia %1!, {r3, r4, ip, lr} @ 4\n\
27 ldmia %0!, {r3, r4, ip, lr} @ 4+1\n\
28 stmia %1!, {r3, r4, ip, lr} @ 4\n\
29 ldmia %0!, {r3, r4, ip, lr} @ 4+1\n\
30 stmia %1!, {r3, r4, ip, lr} @ 4\n\
31 ldmia %0!, {r3, r4, ip, lr} @ 4\n\
32 subs r2, r2, #1 @ 1\n\
33 stmia %1!, {r3, r4, ip, lr} @ 4\n\
34 ldmneia %0!, {r3, r4, ip, lr} @ 4\n\
35 bne 1b @ 1\n\
36 ldmfd sp!, {r4, pc} @ 3"
37 :
38 : "r" (kfrom), "r" (kto), "I" (PAGE_SIZE / 64));
39}
40
41/*
42 * ARMv3 optimised clear_user_page
43 *
44 * FIXME: do we need to handle cache stuff...
45 */
46void __attribute__((naked)) v3_clear_user_page(void *kaddr, unsigned long vaddr)
47{
48 asm("\n\
49 str lr, [sp, #-4]!\n\
50 mov r1, %1 @ 1\n\
51 mov r2, #0 @ 1\n\
52 mov r3, #0 @ 1\n\
53 mov ip, #0 @ 1\n\
54 mov lr, #0 @ 1\n\
551: stmia %0!, {r2, r3, ip, lr} @ 4\n\
56 stmia %0!, {r2, r3, ip, lr} @ 4\n\
57 stmia %0!, {r2, r3, ip, lr} @ 4\n\
58 stmia %0!, {r2, r3, ip, lr} @ 4\n\
59 subs r1, r1, #1 @ 1\n\
60 bne 1b @ 1\n\
61 ldr pc, [sp], #4"
62 :
63 : "r" (kaddr), "I" (PAGE_SIZE / 64));
64}
65
66struct cpu_user_fns v3_user_fns __initdata = {
67 .cpu_clear_user_page = v3_clear_user_page,
68 .cpu_copy_user_page = v3_copy_user_page,
69};