~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mm/copypage-feroceon.c

Version: ~ [ linux-5.4 ] ~ [ linux-5.3.13 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.86 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.156 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.203 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.202 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.78 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  *  linux/arch/arm/mm/copypage-feroceon.S
  3  *
  4  *  Copyright (C) 2008 Marvell Semiconductors
  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  * This handles copy_user_highpage and clear_user_page on Feroceon
 11  * more optimally than the generic implementations.
 12  */
 13 #include <linux/init.h>
 14 #include <linux/highmem.h>
 15 
 16 static void __naked
 17 feroceon_copy_user_page(void *kto, const void *kfrom)
 18 {
 19         asm("\
 20         stmfd   sp!, {r4-r9, lr}                \n\
 21         mov     ip, %2                          \n\
 22 1:      mov     lr, r1                          \n\
 23         ldmia   r1!, {r2 - r9}                  \n\
 24         pld     [lr, #32]                       \n\
 25         pld     [lr, #64]                       \n\
 26         pld     [lr, #96]                       \n\
 27         pld     [lr, #128]                      \n\
 28         pld     [lr, #160]                      \n\
 29         pld     [lr, #192]                      \n\
 30         pld     [lr, #224]                      \n\
 31         stmia   r0, {r2 - r9}                   \n\
 32         ldmia   r1!, {r2 - r9}                  \n\
 33         mcr     p15, 0, r0, c7, c14, 1          @ clean and invalidate D line\n\
 34         add     r0, r0, #32                     \n\
 35         stmia   r0, {r2 - r9}                   \n\
 36         ldmia   r1!, {r2 - r9}                  \n\
 37         mcr     p15, 0, r0, c7, c14, 1          @ clean and invalidate D line\n\
 38         add     r0, r0, #32                     \n\
 39         stmia   r0, {r2 - r9}                   \n\
 40         ldmia   r1!, {r2 - r9}                  \n\
 41         mcr     p15, 0, r0, c7, c14, 1          @ clean and invalidate D line\n\
 42         add     r0, r0, #32                     \n\
 43         stmia   r0, {r2 - r9}                   \n\
 44         ldmia   r1!, {r2 - r9}                  \n\
 45         mcr     p15, 0, r0, c7, c14, 1          @ clean and invalidate D line\n\
 46         add     r0, r0, #32                     \n\
 47         stmia   r0, {r2 - r9}                   \n\
 48         ldmia   r1!, {r2 - r9}                  \n\
 49         mcr     p15, 0, r0, c7, c14, 1          @ clean and invalidate D line\n\
 50         add     r0, r0, #32                     \n\
 51         stmia   r0, {r2 - r9}                   \n\
 52         ldmia   r1!, {r2 - r9}                  \n\
 53         mcr     p15, 0, r0, c7, c14, 1          @ clean and invalidate D line\n\
 54         add     r0, r0, #32                     \n\
 55         stmia   r0, {r2 - r9}                   \n\
 56         ldmia   r1!, {r2 - r9}                  \n\
 57         mcr     p15, 0, r0, c7, c14, 1          @ clean and invalidate D line\n\
 58         add     r0, r0, #32                     \n\
 59         stmia   r0, {r2 - r9}                   \n\
 60         subs    ip, ip, #(32 * 8)               \n\
 61         mcr     p15, 0, r0, c7, c14, 1          @ clean and invalidate D line\n\
 62         add     r0, r0, #32                     \n\
 63         bne     1b                              \n\
 64         mcr     p15, 0, ip, c7, c10, 4          @ drain WB\n\
 65         ldmfd   sp!, {r4-r9, pc}"
 66         :
 67         : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE));
 68 }
 69 
 70 void feroceon_copy_user_highpage(struct page *to, struct page *from,
 71         unsigned long vaddr, struct vm_area_struct *vma)
 72 {
 73         void *kto, *kfrom;
 74 
 75         kto = kmap_atomic(to);
 76         kfrom = kmap_atomic(from);
 77         flush_cache_page(vma, vaddr, page_to_pfn(from));
 78         feroceon_copy_user_page(kto, kfrom);
 79         kunmap_atomic(kfrom);
 80         kunmap_atomic(kto);
 81 }
 82 
 83 void feroceon_clear_user_highpage(struct page *page, unsigned long vaddr)
 84 {
 85         void *ptr, *kaddr = kmap_atomic(page);
 86         asm volatile ("\
 87         mov     r1, %2                          \n\
 88         mov     r2, #0                          \n\
 89         mov     r3, #0                          \n\
 90         mov     r4, #0                          \n\
 91         mov     r5, #0                          \n\
 92         mov     r6, #0                          \n\
 93         mov     r7, #0                          \n\
 94         mov     ip, #0                          \n\
 95         mov     lr, #0                          \n\
 96 1:      stmia   %0, {r2-r7, ip, lr}             \n\
 97         subs    r1, r1, #1                      \n\
 98         mcr     p15, 0, %0, c7, c14, 1          @ clean and invalidate D line\n\
 99         add     %0, %0, #32                     \n\
100         bne     1b                              \n\
101         mcr     p15, 0, r1, c7, c10, 4          @ drain WB"
102         : "=r" (ptr)
103         : "" (kaddr), "I" (PAGE_SIZE / 32)
104         : "r1", "r2", "r3", "r4", "r5", "r6", "r7", "ip", "lr");
105         kunmap_atomic(kaddr);
106 }
107 
108 struct cpu_user_fns feroceon_user_fns __initdata = {
109         .cpu_clear_user_highpage = feroceon_clear_user_highpage,
110         .cpu_copy_user_highpage = feroceon_copy_user_highpage,
111 };
112 
113 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp