1 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/lib/memset.c linux-2.6.19.2/arch/cris/arch-v10/lib/memset.c
2 --- linux-2.6.19.2.orig/arch/cris/arch-v10/lib/memset.c 2007-06-03 13:59:39.000000000 +0200
3 +++ linux-2.6.19.2/arch/cris/arch-v10/lib/memset.c 2007-06-03 14:11:43.000000000 +0200
5 If you want to check that the allocation was right; then
6 check the equalities in the first comment. It should say
7 "r13=r13, r12=r12, r11=r11" */
9 - ;; Check that the following is true (same register names on
10 - ;; both sides of equal sign, as in r8=r8):
11 - ;; %0=r13, %1=r12, %4=r11
13 - ;; Save the registers we'll clobber in the movem process
14 - ;; on the stack. Don't mention them to gcc, it will only be
31 - ;; Now we've got this:
36 + "movem $r10,[$sp]\n\t"
37 + "move.d $r11,$r0\n\t"
38 + "move.d $r11,$r1\n\t"
39 + "move.d $r11,$r2\n\t"
40 + "move.d $r11,$r3\n\t"
41 + "move.d $r11,$r4\n\t"
42 + "move.d $r11,$r5\n\t"
43 + "move.d $r11,$r6\n\t"
44 + "move.d $r11,$r7\n\t"
45 + "move.d $r11,$r8\n\t"
46 + "move.d $r11,$r9\n\t"
47 + "move.d $r11,$r10\n\t"
48 + "subq 12*4,$r12\n\t"
50 + "subq 12*4,$r12\n\t"
52 + "movem $r11,[$r13+]\n\t"
53 + "addq 12*4,$r12\n\t"
56 - ;; Update n for the first loop
63 - addq 12*4,$r12 ;; compensate for last loop underflowing n
65 - ;; Restore registers from stack
68 /* Outputs */ : "=r" (dst), "=r" (n)
69 /* Inputs */ : "0" (dst), "1" (n), "r" (lc));
75 - *((long*)dst)++ = lc;
76 - *((long*)dst)++ = lc;
77 - *((long*)dst)++ = lc;
78 - *((long*)dst)++ = lc;
91 *(short*)dst = (short) lc;
94 - *((short*)dst)++ = (short) lc;
95 + *((short*)dst) = (short) lc;
97 *(char*)dst = (char) lc;
100 - *((long*)dst)++ = lc;
101 + *((long*)dst) = lc;
105 - *((long*)dst)++ = lc;
106 + *((long*)dst) = lc;
108 *(char*)dst = (char) lc;
111 - *((long*)dst)++ = lc;
112 + *((long*)dst) = lc;
114 *(short*)dst = (short) lc;
117 - *((long*)dst)++ = lc;
118 - *((short*)dst)++ = (short) lc;
119 + *((long*)dst) = lc;
121 + *((short*)dst) = (short) lc;
123 *(char*)dst = (char) lc;
126 - *((long*)dst)++ = lc;
127 - *((long*)dst)++ = lc;
128 + *((long*)dst) = lc;
130 + *((long*)dst) = lc;
134 - *((long*)dst)++ = lc;
135 - *((long*)dst)++ = lc;
136 + *((long*)dst) = lc;
138 + *((long*)dst) = lc;
140 *(char*)dst = (char) lc;
143 - *((long*)dst)++ = lc;
144 - *((long*)dst)++ = lc;
145 + *((long*)dst) = lc;
147 + *((long*)dst) = lc;
149 *(short*)dst = (short) lc;
152 - *((long*)dst)++ = lc;
153 - *((long*)dst)++ = lc;
154 - *((short*)dst)++ = (short) lc;
155 + *((long*)dst) = lc;
157 + *((long*)dst) = lc;
159 + *((short*)dst) = (short) lc;
161 *(char*)dst = (char) lc;
164 - *((long*)dst)++ = lc;
165 - *((long*)dst)++ = lc;
166 - *((long*)dst)++ = lc;
167 + *((long*)dst) = lc;
169 + *((long*)dst) = lc;
171 + *((long*)dst) = lc;
175 - *((long*)dst)++ = lc;
176 - *((long*)dst)++ = lc;
177 - *((long*)dst)++ = lc;
178 + *((long*)dst) = lc;
180 + *((long*)dst) = lc;
182 + *((long*)dst) = lc;
184 *(char*)dst = (char) lc;
187 - *((long*)dst)++ = lc;
188 - *((long*)dst)++ = lc;
189 - *((long*)dst)++ = lc;
190 + *((long*)dst) = lc;
192 + *((long*)dst) = lc;
194 + *((long*)dst) = lc;
196 *(short*)dst = (short) lc;
199 - *((long*)dst)++ = lc;
200 - *((long*)dst)++ = lc;
201 - *((long*)dst)++ = lc;
202 - *((short*)dst)++ = (short) lc;
203 + *((long*)dst) = lc;
205 + *((long*)dst) = lc;
207 + *((long*)dst) = lc;
209 + *((short*)dst) = (short) lc;
211 *(char*)dst = (char) lc;
214 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/lib/string.c linux-2.6.19.2/arch/cris/arch-v10/lib/string.c
215 --- linux-2.6.19.2.orig/arch/cris/arch-v10/lib/string.c 2007-06-03 13:59:39.000000000 +0200
216 +++ linux-2.6.19.2/arch/cris/arch-v10/lib/string.c 2007-06-03 14:21:02.000000000 +0200
218 If you want to check that the allocation was right; then
219 check the equalities in the first comment. It should say
220 "r13=r13, r11=r11, r12=r12" */
221 - __asm__ volatile ("
222 - ;; Check that the following is true (same register names on
223 - ;; both sides of equal sign, as in r8=r8):
224 - ;; %0=r13, %1=r11, %2=r12
226 - ;; Save the registers we'll use in the movem process
231 - ;; Now we've got this:
236 - ;; Update n for the first loop
244 - addq 44,$r12 ;; compensate for last loop underflowing n
246 - ;; Restore registers from stack
250 + "subq 11*4,$sp\n\t"
251 + "movem $r10,[$sp]\n\t"
254 + "movem [$r11+],$r10\n\t"
257 + "movem $r10,[$r13+]\n\t"
259 + "movem [$sp+],$r10\n\t"
260 /* Outputs */ : "=r" (dst), "=r" (src), "=r" (n)
261 /* Inputs */ : "0" (dst), "1" (src), "2" (n));
265 /* Either we directly starts copying, using dword copying
266 @@ -135,10 +117,14 @@
270 - *((long*)dst)++ = *((long*)src)++;
271 - *((long*)dst)++ = *((long*)src)++;
272 - *((long*)dst)++ = *((long*)src)++;
273 - *((long*)dst)++ = *((long*)src)++;
274 + *((long*)dst) = *((long*)src);
276 + *((long*)dst) = *((long*)src);
278 + *((long*)dst) = *((long*)src);
280 + *((long*)dst) = *((long*)src);
285 @@ -156,67 +142,95 @@
286 *(short*)dst = *(short*)src;
289 - *((short*)dst)++ = *((short*)src)++;
290 + *((short*)dst) = *((short*)src);
292 *(char*)dst = *(char*)src;
295 - *((long*)dst)++ = *((long*)src)++;
296 + *((long*)dst) = *((long*)src);
300 - *((long*)dst)++ = *((long*)src)++;
301 + *((long*)dst) = *((long*)src);
303 *(char*)dst = *(char*)src;
306 - *((long*)dst)++ = *((long*)src)++;
307 + *((long*)dst) = *((long*)src);
309 *(short*)dst = *(short*)src;
312 - *((long*)dst)++ = *((long*)src)++;
313 - *((short*)dst)++ = *((short*)src)++;
314 + *((long*)dst) = *((long*)src);
316 + *((short*)dst) = *((short*)src);
318 *(char*)dst = *(char*)src;
321 - *((long*)dst)++ = *((long*)src)++;
322 - *((long*)dst)++ = *((long*)src)++;
323 + *((long*)dst) = *((long*)src);
325 + *((long*)dst) = *((long*)src);
329 - *((long*)dst)++ = *((long*)src)++;
330 - *((long*)dst)++ = *((long*)src)++;
331 + *((long*)dst) = *((long*)src);
333 + *((long*)dst) = *((long*)src);
335 *(char*)dst = *(char*)src;
338 - *((long*)dst)++ = *((long*)src)++;
339 - *((long*)dst)++ = *((long*)src)++;
340 + *((long*)dst) = *((long*)src);
342 + *((long*)dst) = *((long*)src);
344 *(short*)dst = *(short*)src;
347 - *((long*)dst)++ = *((long*)src)++;
348 - *((long*)dst)++ = *((long*)src)++;
349 - *((short*)dst)++ = *((short*)src)++;
350 + *((long*)dst) = *((long*)src);
352 + *((long*)dst) = *((long*)src);
354 + *((short*)dst) = *((short*)src);
356 *(char*)dst = *(char*)src;
359 - *((long*)dst)++ = *((long*)src)++;
360 - *((long*)dst)++ = *((long*)src)++;
361 - *((long*)dst)++ = *((long*)src)++;
362 + *((long*)dst) = *((long*)src);
364 + *((long*)dst) = *((long*)src);
366 + *((long*)dst) = *((long*)src);
370 - *((long*)dst)++ = *((long*)src)++;
371 - *((long*)dst)++ = *((long*)src)++;
372 - *((long*)dst)++ = *((long*)src)++;
373 + *((long*)dst) = *((long*)src);
375 + *((long*)dst) = *((long*)src);
377 + *((long*)dst) = *((long*)src);
379 *(char*)dst = *(char*)src;
382 - *((long*)dst)++ = *((long*)src)++;
383 - *((long*)dst)++ = *((long*)src)++;
384 - *((long*)dst)++ = *((long*)src)++;
385 + *((long*)dst) = *((long*)src);
387 + *((long*)dst) = *((long*)src);
389 + *((long*)dst) = *((long*)src);
391 *(short*)dst = *(short*)src;
394 - *((long*)dst)++ = *((long*)src)++;
395 - *((long*)dst)++ = *((long*)src)++;
396 - *((long*)dst)++ = *((long*)src)++;
397 - *((short*)dst)++ = *((short*)src)++;
398 + *((long*)dst) = *((long*)src);
400 + *((long*)dst) = *((long*)src);
402 + *((long*)dst) = *((long*)src);
404 + *((short*)dst) = *((short*)src);
406 *(char*)dst = *(char*)src;
409 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/lib/usercopy.c linux-2.6.19.2/arch/cris/arch-v10/lib/usercopy.c
410 --- linux-2.6.19.2.orig/arch/cris/arch-v10/lib/usercopy.c 2007-06-03 13:59:39.000000000 +0200
411 +++ linux-2.6.19.2/arch/cris/arch-v10/lib/usercopy.c 2007-06-03 14:25:55.000000000 +0200
413 If you want to check that the allocation was right; then
414 check the equalities in the first comment. It should say
415 "r13=r13, r11=r11, r12=r12". */
416 - __asm__ volatile ("\
417 - .ifnc %0%1%2%3,$r13$r11$r12$r10 \n\
421 - ;; Save the registers we'll use in the movem process
426 - ;; Now we've got this:
431 - ;; Update n for the first loop
434 -; Since the noted PC of a faulting instruction in a delay-slot of a taken
435 -; branch, is that of the branch target, we actually point at the from-movem
436 -; for this case. There is no ambiguity here; if there was a fault in that
437 -; instruction (meaning a kernel oops), the faulted PC would be the address
438 -; after *that* movem.
446 - addq 44,$r12 ;; compensate for last loop underflowing n
448 - ;; Restore registers from stack
451 - .section .fixup,\"ax\"
453 -; To provide a correct count in r10 of bytes that failed to be copied,
454 -; we jump back into the loop if the loop-branch was taken. There is no
455 -; performance penalty for sany use; the program will segfault soon enough.
469 - .section __ex_table,\"a\"
474 + ".ifnc %0%1%2%3,$r13$r11$r12$r10 \n\t"
477 + "subq 11*4,$sp\n\t"
478 + "movem $r10,[$sp]\n\t"
481 + "movem [$r11+],$r10\n\t"
484 + "movem $r10,[$r13+]\n\t"
486 + "addq 44,$r12 \n\t"
487 + "movem [$sp+],$r10\n\t"
489 + ".section .fixup,\"ax\"\n\t"
491 + "move.d [$sp],$r10\n\t"
493 + "move.d $r10,[$sp]\n\t"
496 + "movem [$sp+],$r10\n\t"
501 + ".section __ex_table,\"a\"\n\t"
506 /* Outputs */ : "=r" (dst), "=r" (src), "=r" (n), "=r" (retn)
507 /* Inputs */ : "0" (dst), "1" (src), "2" (n), "3" (retn));
508 @@ -253,60 +228,32 @@
509 If you want to check that the allocation was right; then
510 check the equalities in the first comment. It should say
511 "r13=r13, r11=r11, r12=r12" */
512 - __asm__ volatile ("
513 - .ifnc %0%1%2%3,$r13$r11$r12$r10 \n\
517 - ;; Save the registers we'll use in the movem process
522 - ;; Now we've got this:
527 - ;; Update n for the first loop
536 - addq 44,$r12 ;; compensate for last loop underflowing n
538 - ;; Restore registers from stack
541 - .section .fixup,\"ax\"
543 -;; Do not jump back into the loop if we fail. For some uses, we get a
544 -;; page fault somewhere on the line. Without checking for page limits,
545 -;; we don't know where, but we need to copy accurately and keep an
546 -;; accurate count; not just clear the whole line. To do that, we fall
547 -;; down in the code below, proceeding with smaller amounts. It should
548 -;; be kept in mind that we have to cater to code like what at one time
549 -;; was in fs/super.c:
550 -;; i = size - copy_from_user((void *)page, data, size);
551 -;; which would cause repeated faults while clearing the remainder of
552 -;; the SIZE bytes at PAGE after the first fault.
553 -;; A caveat here is that we must not fall through from a failing page
558 - addq 44,$r12 ;; Get back count before faulting point.
559 - subq 44,$r11 ;; Get back pointer to faulting movem-line.
560 - jump 4b ;; Fall through, pretending the fault didn't happen.
563 - .section __ex_table,\"a\"
567 + ".ifnc %0%1%2%3,$r13$r11$r12$r10 \n\t"
570 + "subq 11*4,$sp\n\t"
571 + "movem $r10,[$sp]\n\t"
574 + "movem [$r11+],$r10\n\t"
578 + "movem $r10,[$r13+]\n\t"
579 + "addq 44,$r12 \n\t"
580 + "movem [$sp+],$r10\n\t"
582 + ".section .fixup,\"ax\"\n\t"
584 + "movem [$sp+],$r10\n\t"
589 + ".section __ex_table,\"a\"\n\t"
593 /* Outputs */ : "=r" (dst), "=r" (src), "=r" (n), "=r" (retn)
594 /* Inputs */ : "0" (dst), "1" (src), "2" (n), "3" (retn));
595 @@ -425,66 +372,50 @@
596 If you want to check that the allocation was right; then
597 check the equalities in the first comment. It should say
598 something like "r13=r13, r11=r11, r12=r12". */
599 - __asm__ volatile ("
600 - .ifnc %0%1%2,$r13$r12$r10 \n\
604 - ;; Save the registers we'll clobber in the movem process
605 - ;; on the stack. Don't mention them to gcc, it will only be
623 - ;; Now we've got this:
627 - ;; Update n for the first loop
634 - addq 12*4,$r12 ;; compensate for last loop underflowing n
636 - ;; Restore registers from stack
639 - .section .fixup,\"ax\"
654 - .section __ex_table,\"a\"
660 + ".ifnc %0%1%2,$r13$r12$r10\n\t"
663 + "subq 11*4,$sp\n\t"
664 + "movem $r10,[$sp]\n\t"
677 + "subq 12*4,$r12\n\t"
679 + "subq 12*4,$r12\n\t"
681 + "movem $r11,[$r13+]\n\t"
683 + "addq 12*4,$r12 \n\t"
684 + "movem [$sp+],$r10\n\t"
686 + ".section .fixup,\"ax\"\n\t"
688 + "move.d [$sp],$r10\n\t"
689 + "addq 12*4,$r10\n\t"
690 + "move.d $r10,[$sp]\n\t"
694 + "movem [$sp+],$r10\n\t"
695 + "addq 12*4,$r10\n\t"
696 + "addq 12*4,$r12\n\t"
699 + ".section __ex_table,\"a\"\n\t"
703 /* Outputs */ : "=r" (dst), "=r" (n), "=r" (retn)
704 /* Inputs */ : "0" (dst), "1" (n), "2" (retn)
705 /* Clobber */ : "r11");