Go to the documentation of this file.
11 #include <asm/uaccess.h>
45 register const char *
src __asm__ (
"r11") = psrc;
47 register int retn
__asm__ (
"r10") = 0;
53 if (((
unsigned long)
dst & 3) != 0
58 if ((
unsigned long) dst & 1)
64 if ((
unsigned long) dst & 2)
92 .ifnc %0%1%2%3,$r13$r11$r12$r10 \n\
96 ;; Save the registers we'll use in the movem process \n\
101 ;; Now we've got this: \n\
106 ;; Update n for the first loop \n\
109 ; Since the noted PC of a faulting instruction in a delay-slot of a taken \n\
110 ; branch, is that of the branch target, we actually point at the from-movem \n\
111 ; for this case. There is no ambiguity here; if there was a fault in that \n\
112 ; instruction (meaning a kernel oops), the faulted PC would be the address \n\
113 ; after *that* movem. \n\
116 movem [$r11+],$r10 \n\
119 movem $r10,[$r13+] \n\
121 addq 44,$r12 ;; compensate for last loop underflowing n \n\
123 ;; Restore registers from stack \n\
124 movem [$sp+],$r10 \n\
126 .section .fixup,\"ax\" \n\
128 ; To provide a correct count in r10 of bytes that failed to be copied, \n\
129 ; we jump back into the loop if the loop-branch was taken. There is no \n\
130 ; performance penalty for sany use; the program will segfault soon enough.\n\
133 move.d [$sp],$r10 \n\
135 move.d $r10,[$sp] \n\
138 movem [$sp+],$r10 \n\
144 .section __ex_table,\"a\" \n\
149 :
"=r" (
dst),
"=r" (
src),
"=r" (
n),
"=r" (retn)
150 :
"0" (
dst),
"1" (
src),
"2" (
n),
"3" (retn));
207 register const char *
src __asm__ (
"r11") = psrc;
209 register int retn
__asm__ (
"r10") = 0;
214 if (((
unsigned long)
src & 3) != 0)
216 if (((
unsigned long) src & 1) &&
n != 0)
222 if (((
unsigned long) src & 2) &&
n >= 2)
232 goto copy_exception_bytes;
257 .ifnc %0%1%2%3,$r13$r11$r12$r10 \n\
261 ;; Save the registers we'll use in the movem process \n\
266 ;; Now we've got this: \n\
271 ;; Update n for the first loop \n\
274 movem [$r11+],$r10 \n\
278 movem $r10,[$r13+] \n\
280 addq 44,$r12 ;; compensate for last loop underflowing n \n\
282 ;; Restore registers from stack \n\
283 movem [$sp+],$r10 \n\
285 .section .fixup,\"ax\" \n\
287 ;; Do not jump back into the loop if we fail. For some uses, we get a \n\
288 ;; page fault somewhere on the line. Without checking for page limits, \n\
289 ;; we don't know where, but we need to copy accurately and keep an \n\
290 ;; accurate count; not just clear the whole line. To do that, we fall \n\
291 ;; down in the code below, proceeding with smaller amounts. It should \n\
292 ;; be kept in mind that we have to cater to code like what at one time \n\
293 ;; was in fs/super.c: \n\
294 ;; i = size - copy_from_user((void *)page, data, size); \n\
295 ;; which would cause repeated faults while clearing the remainder of \n\
296 ;; the SIZE bytes at PAGE after the first fault. \n\
297 ;; A caveat here is that we must not fall through from a failing page \n\
298 ;; to a valid page. \n\
301 movem [$sp+],$r10 \n\
302 addq 44,$r12 ;; Get back count before faulting point. \n\
303 subq 44,$r11 ;; Get back pointer to faulting movem-line. \n\
304 jump 4b ;; Fall through, pretending the fault didn't happen.\n\
307 .section __ex_table,\"a\" \n\
311 :
"=r" (
dst),
"=r" (src),
"=r" (
n),
"=r" (retn)
312 :
"0" (
dst),
"1" (src),
"2" (
n),
"3" (retn));
331 goto copy_exception_bytes;
359 copy_exception_bytes:
388 register int retn
__asm__ (
"r10") = 0;
391 if (((
unsigned long)
dst & 3) != 0
395 if ((
unsigned long) dst & 1)
401 if ((
unsigned long) dst & 2)
429 .ifnc %0%1%2,$r13$r12$r10 \n\
433 ;; Save the registers we'll clobber in the movem process \n\
434 ;; on the stack. Don't mention them to gcc, it will only be \n\
452 ;; Now we've got this: \n\
456 ;; Update n for the first loop \n\
461 movem $r11,[$r13+] \n\
463 addq 12*4,$r12 ;; compensate for last loop underflowing n\n\
465 ;; Restore registers from stack \n\
466 movem [$sp+],$r10 \n\
468 .section .fixup,\"ax\" \n\
470 move.d [$sp],$r10 \n\
472 move.d $r10,[$sp] \n\
477 movem [$sp+],$r10 \n\
483 .section __ex_table,\"a\" \n\
488 :
"=r" (
dst),
"=r" (
n),
"=r" (retn)
489 :
"0" (dst),
"1" (
n),
"2" (retn)