2 * linux/arch/arm/lib/copypage-xscale.S
4 * Copyright (C) 2001 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/linkage.h>
11 #include <linux/init.h>
12 #include <asm/constants.h>
16 * We don't really want write-allocate cache behaviour for these functions
17 * since that will just eat through 8K of the cache.
23 * XScale optimised copy_user_page
26 * r2 = virtual user address of ultimate destination page
28 * The source page may have some clean entries in the cache already, but we
29 * can safely ignore them - break_cow() will flush them out of the cache
30 * if we eventually end up using our copied page.
32 * What we could do is use the mini-cache to buffer reads from the source
33 * page. We rely on the mini-cache being smaller than one page, so we'll
34 * cycle through the complete cache anyway.
36 ENTRY(xscale_mc_copy_user_page)
37 stmfd sp!, {r4, r5, lr}
45 * Strangely enough, best performance is achieved
46 * when prefetching destination as well. (NP)
67 mcr p15, 0, ip, c7, c10, 1 @ clean D line
69 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line
78 mcr p15, 0, ip, c7, c10, 1 @ clean D line
80 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line
84 ldmfd sp!, {r4, r5, pc}
88 * XScale optimised clear_user_page
90 * r1 = virtual user address of ultimate destination page
92 ENTRY(xscale_mc_clear_user_page)
101 mcr p15, 0, ip, c7, c10, 1 @ clean D line
103 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line
109 .type xscale_mc_user_fns, #object
110 ENTRY(xscale_mc_user_fns)
111 .long xscale_mc_clear_user_page
112 .long xscale_mc_copy_user_page
113 .size xscale_mc_user_fns, . - xscale_mc_user_fns