Go to the documentation of this file.
11 #include <asm/uaccess.h>
41 register const char *
src __asm__ (
"r11") = psrc;
43 register int retn
__asm__ (
"r10") = 0;
49 if (((
unsigned long)
dst & 3) != 0
54 if ((
unsigned long) dst & 1)
60 if ((
unsigned long) dst & 2)
78 ;; Check that the register asm declaration got right. \n\
79 ;; The GCC manual explicitly says TRT will happen. \n\
80 .ifnc %0%1%2%3,$r13$r11$r12$r10 \n\
84 ;; Save the registers we'll use in the movem process \n\
89 ;; Now we've got this: \n\
94 ;; Update n for the first loop \n\
97 movem [$r11+],$r10 \n\
100 movem $r10,[$r13+] \n\
102 addq 44,$r12 ;; compensate for last loop underflowing n \n\
104 ;; Restore registers from stack \n\
105 movem [$sp+],$r10 \n\
107 .section .fixup,\"ax\" \n\
109 ; When failing on any of the 1..44 bytes in a chunk, we adjust back the \n\
110 ; source pointer and just drop through to the by-16 and by-4 loops to \n\
111 ; get the correct number of failing bytes. This necessarily means a \n\
112 ; few extra exceptions, but invalid user pointers shouldn't happen in \n\
113 ; time-critical code anyway. \n\
118 .section __ex_table,\"a\" \n\
122 :
"=r" (
dst),
"=r" (
src),
"=r" (
n),
"=r" (retn)
123 :
"0" (
dst),
"1" (
src),
"2" (
n),
"3" (retn));
175 register const char *
src __asm__ (
"r11") = psrc;
177 register int retn
__asm__ (
"r10") = 0;
182 if (((
unsigned long)
src & 3) != 0)
184 if (((
unsigned long) src & 1) &&
n != 0)
190 if (((
unsigned long) src & 2) &&
n >= 2)
200 goto copy_exception_bytes;
212 .ifnc %0%1%2%3,$r13$r11$r12$r10 \n\
216 ;; Save the registers we'll use in the movem process \n\
221 ;; Now we've got this: \n\
226 ;; Update n for the first loop \n\
229 movem [$r11+],$r10 \n\
233 movem $r10,[$r13+] \n\
236 addq 44,$r12 ;; compensate for last loop underflowing n \n\
238 ;; Restore registers from stack \n\
239 movem [$sp+],$r10 \n\
240 .section .fixup,\"ax\" \n\
242 ;; Do not jump back into the loop if we fail. For some uses, we get a \n\
243 ;; page fault somewhere on the line. Without checking for page limits, \n\
244 ;; we don't know where, but we need to copy accurately and keep an \n\
245 ;; accurate count; not just clear the whole line. To do that, we fall \n\
246 ;; down in the code below, proceeding with smaller amounts. It should \n\
247 ;; be kept in mind that we have to cater to code like what at one time \n\
248 ;; was in fs/super.c: \n\
249 ;; i = size - copy_from_user((void *)page, data, size); \n\
250 ;; which would cause repeated faults while clearing the remainder of \n\
251 ;; the SIZE bytes at PAGE after the first fault. \n\
252 ;; A caveat here is that we must not fall through from a failing page \n\
253 ;; to a valid page. \n\
256 jump 4b ;; Fall through, pretending the fault didn't happen. \n\
260 .section __ex_table,\"a\" \n\
264 :
"=r" (
dst),
"=r" (src),
"=r" (
n),
"=r" (retn)
265 :
"0" (
dst),
"1" (src),
"2" (
n),
"3" (retn));
283 goto copy_exception_bytes;
311 copy_exception_bytes:
340 register int retn
__asm__ (
"r10") = 0;
343 if (((
unsigned long)
dst & 3) != 0
347 if ((
unsigned long) dst & 1)
353 if ((
unsigned long) dst & 2)
381 .ifnc %0%1%2,$r13$r12$r10 \n\
385 ;; Save the registers we'll clobber in the movem process \n\
386 ;; on the stack. Don't mention them to gcc, it will only be \n\
404 ;; Now we've got this: \n\
408 ;; Update n for the first loop \n\
414 movem $r11,[$r13+] \n\
416 addq 12*4,$r12 ;; compensate for last loop underflowing n \n\
418 ;; Restore registers from stack \n\
419 movem [$sp+],$r10 \n\
421 .section .fixup,\"ax\" \n\
431 .section __ex_table,\"a\" \n\
435 :
"=r" (
dst),
"=r" (
n),
"=r" (retn)
436 :
"0" (dst),
"1" (
n),
"2" (retn)