2 * linux/arch/arm/mm/copypage-xsc3.S
4 * Copyright (C) 2004 Intel Corp.
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 * Adapted for 3rd gen XScale core, no more mini-dcache
11 * Author: Matt Gilbert (matthew.m.gilbert@intel.com)
13 #include <linux/init.h>
14 #include <linux/highmem.h>
18 * We don't really want write-allocate cache behaviour for these functions
19 * since that will just eat through 8K of the cache.
23 * XSC3 optimised copy_user_highpage
25 * The source page may have some clean entries in the cache already, but we
26 * can safely ignore them - break_cow() will flush them out of the cache
27 * if we eventually end up using our copied page.
30 static void xsc3_mc_copy_user_page(void *kto, const void *kfrom)
40 2: ldrd r2, [%1], #8 \n\
42 mcr p15, 0, %0, c7, c6, 1 @ invalidate\n\
51 mcr p15, 0, %0, c7, c6, 1 @ invalidate\n\
61 : "+&r" (kto), "+&r" (kfrom), "=&r" (tmp)
62 : "2" (PAGE_SIZE / 64 - 1)
63 : "r2", "r3", "r4", "r5");
66 void xsc3_mc_copy_user_highpage(struct page *to, struct page *from,
67 unsigned long vaddr, struct vm_area_struct *vma)
71 kto = kmap_atomic(to);
72 kfrom = kmap_atomic(from);
73 flush_cache_page(vma, vaddr, page_to_pfn(from));
74 xsc3_mc_copy_user_page(kto, kfrom);
80 * XScale optimised clear_user_page
82 void xsc3_mc_clear_user_highpage(struct page *page, unsigned long vaddr)
84 void *ptr, *kaddr = kmap_atomic(page);
89 1: mcr p15, 0, %0, c7, c6, 1 @ invalidate line\n\
97 : "0" (kaddr), "I" (PAGE_SIZE / 32)
102 struct cpu_user_fns xsc3_mc_user_fns __initdata = {
103 .cpu_clear_user_highpage = xsc3_mc_clear_user_highpage,
104 .cpu_copy_user_highpage = xsc3_mc_copy_user_highpage,