2 * linux/arch/arm/mm/copypage-v3.c
4 * Copyright (C) 1995-1999 Russell King
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.
10 #include <linux/init.h>
11 #include <linux/highmem.h>
14 * ARMv3 optimised copy_user_highpage
16 * FIXME: do we need to handle cache stuff...
19 v3_copy_user_page(void *kto, const void *kfrom)
22 stmfd sp!, {r4, lr} @ 2\n\
24 ldmia %0!, {r3, r4, ip, lr} @ 4+1\n\
25 1: stmia %1!, {r3, r4, ip, lr} @ 4\n\
26 ldmia %0!, {r3, r4, ip, lr} @ 4+1\n\
27 stmia %1!, {r3, r4, ip, lr} @ 4\n\
28 ldmia %0!, {r3, r4, ip, lr} @ 4+1\n\
29 stmia %1!, {r3, r4, ip, lr} @ 4\n\
30 ldmia %0!, {r3, r4, ip, lr} @ 4\n\
31 subs r2, r2, #1 @ 1\n\
32 stmia %1!, {r3, r4, ip, lr} @ 4\n\
33 ldmneia %0!, {r3, r4, ip, lr} @ 4\n\
35 ldmfd sp!, {r4, pc} @ 3"
37 : "r" (kfrom), "r" (kto), "I" (PAGE_SIZE / 64));
40 void v3_copy_user_highpage(struct page *to, struct page *from,
45 kto = kmap_atomic(to, KM_USER0);
46 kfrom = kmap_atomic(from, KM_USER1);
47 v3_copy_user_page(kto, kfrom);
48 kunmap_atomic(kfrom, KM_USER1);
49 kunmap_atomic(kto, KM_USER0);
53 * ARMv3 optimised clear_user_page
55 * FIXME: do we need to handle cache stuff...
57 void v3_clear_user_highpage(struct page *page, unsigned long vaddr)
59 void *ptr, *kaddr = kmap_atomic(page, KM_USER0);
66 1: stmia %0!, {r2, r3, ip, lr} @ 4\n\
67 stmia %0!, {r2, r3, ip, lr} @ 4\n\
68 stmia %0!, {r2, r3, ip, lr} @ 4\n\
69 stmia %0!, {r2, r3, ip, lr} @ 4\n\
70 subs r1, r1, #1 @ 1\n\
73 : "0" (kaddr), "I" (PAGE_SIZE / 64)
74 : "r1", "r2", "r3", "ip", "lr");
75 kunmap_atomic(kaddr, KM_USER0);
78 struct cpu_user_fns v3_user_fns __initdata = {
79 .cpu_clear_user_highpage = v3_clear_user_highpage,
80 .cpu_copy_user_highpage = v3_copy_user_highpage,