2 * Copyright 2008 Vitaly Mayatskikh <vmayatsk@redhat.com>
3 * Copyright 2002 Andi Kleen, SuSE Labs.
4 * Subject to the GNU Public License v2.
6 * Functions to copy from and to user space.
9 #include <linux/linkage.h>
10 #include <asm/dwarf2.h>
12 #define FIX_ALIGNMENT 1
14 #include <asm/current.h>
15 #include <asm/asm-offsets.h>
16 #include <asm/thread_info.h>
18 .macro ALIGN_DESTINATION
20 /* check for bad alignment of destination */
23 jz 102f /* already aligned */
35 103: addl %ecx,%edx /* ecx is zerorest also */
36 jmp copy_user_handle_tail
39 .section __ex_table,"a"
48 * copy_user_nocache - Uncached memory copy with exception handling
49 * This will force destination/source out of cache for more performance.
51 ENTRY(__copy_user_nocache)
54 jb 20f /* less then 8 bytes, go to byte copy loop */
62 3: movq 2*8(%rsi),%r10
63 4: movq 3*8(%rsi),%r11
65 6: movnti %r9,1*8(%rdi)
66 7: movnti %r10,2*8(%rdi)
67 8: movnti %r11,3*8(%rdi)
69 10: movq 5*8(%rsi),%r9
70 11: movq 6*8(%rsi),%r10
71 12: movq 7*8(%rsi),%r11
72 13: movnti %r8,4*8(%rdi)
73 14: movnti %r9,5*8(%rdi)
74 15: movnti %r10,6*8(%rdi)
75 16: movnti %r11,7*8(%rdi)
107 40: lea (%rdx,%rcx,8),%rdx
111 jmp copy_user_handle_tail
114 .section __ex_table,"a"
137 ENDPROC(__copy_user_nocache)