Loading arch/cris/arch-v10/lib/usercopy.c +6 −18 Original line number Original line Diff line number Diff line Loading @@ -217,19 +217,17 @@ unsigned long __copy_user_zeroing(void *pdst, const void __user *psrc, { { __asm_copy_from_user_1 (dst, src, retn); __asm_copy_from_user_1 (dst, src, retn); n--; n--; if (retn) goto exception; } } if (((unsigned long) src & 2) && n >= 2) if (((unsigned long) src & 2) && n >= 2) { { __asm_copy_from_user_2 (dst, src, retn); __asm_copy_from_user_2 (dst, src, retn); n -= 2; n -= 2; if (retn) goto exception; } } /* We only need one check after the unalignment-adjustments, because if both adjustments were done, either both or neither reference had an exception. */ if (retn != 0) goto copy_exception_bytes; } } /* Decide which copying method to use. */ /* Decide which copying method to use. */ Loading Loading @@ -328,7 +326,7 @@ unsigned long __copy_user_zeroing(void *pdst, const void __user *psrc, n -= 4; n -= 4; if (retn) if (retn) goto copy_exception_bytes; goto exception; } } /* If we get here, there were no memory read faults. */ /* If we get here, there were no memory read faults. */ Loading Loading @@ -356,17 +354,7 @@ unsigned long __copy_user_zeroing(void *pdst, const void __user *psrc, bytes. */ bytes. */ return retn; return retn; copy_exception_bytes: exception: /* We already have "retn" bytes cleared, and need to clear the remaining "n" bytes. A non-optimized simple byte-for-byte in-line memset is preferred here, since this isn't speed-critical code and we'd rather have this a leaf-function than calling memset. */ { char *endp; for (endp = dst + n; dst < endp; dst++) *dst = 0; } return retn + n; return retn + n; } } EXPORT_SYMBOL(__copy_user_zeroing); EXPORT_SYMBOL(__copy_user_zeroing); Loading arch/cris/arch-v32/lib/usercopy.c +6 −17 Original line number Original line Diff line number Diff line Loading @@ -184,19 +184,18 @@ unsigned long __copy_user_zeroing(void *pdst, const void __user *psrc, { { __asm_copy_from_user_1 (dst, src, retn); __asm_copy_from_user_1 (dst, src, retn); n--; n--; if (retn != 0) goto exception; } } if (((unsigned long) src & 2) && n >= 2) if (((unsigned long) src & 2) && n >= 2) { { __asm_copy_from_user_2 (dst, src, retn); __asm_copy_from_user_2 (dst, src, retn); n -= 2; n -= 2; if (retn != 0) goto exception; } } /* We only need one check after the unalignment-adjustments, because if both adjustments were done, either both or neither reference had an exception. */ if (retn != 0) goto copy_exception_bytes; } } /* Movem is dirt cheap. The overheap is low enough to always use the /* Movem is dirt cheap. The overheap is low enough to always use the Loading Loading @@ -279,7 +278,7 @@ unsigned long __copy_user_zeroing(void *pdst, const void __user *psrc, n -= 4; n -= 4; if (retn) if (retn) goto copy_exception_bytes; goto exception; } } /* If we get here, there were no memory read faults. */ /* If we get here, there were no memory read faults. */ Loading Loading @@ -307,17 +306,7 @@ unsigned long __copy_user_zeroing(void *pdst, const void __user *psrc, bytes. */ bytes. */ return retn; return retn; copy_exception_bytes: exception: /* We already have "retn" bytes cleared, and need to clear the remaining "n" bytes. A non-optimized simple byte-for-byte in-line memset is preferred here, since this isn't speed-critical code and we'd rather have this a leaf-function than calling memset. */ { char *endp; for (endp = dst + n; dst < endp; dst++) *dst = 0; } return retn + n; return retn + n; } } EXPORT_SYMBOL(__copy_user_zeroing); EXPORT_SYMBOL(__copy_user_zeroing); Loading arch/cris/include/arch-v10/arch/uaccess.h +4 −8 Original line number Original line Diff line number Diff line Loading @@ -172,16 +172,14 @@ __do_strncpy_from_user(char *dst, const char *src, long count) __asm_copy_user_cont(to, from, ret, \ __asm_copy_user_cont(to, from, ret, \ " move.b [%1+],$r9\n" \ " move.b [%1+],$r9\n" \ "2: move.b $r9,[%0+]\n", \ "2: move.b $r9,[%0+]\n", \ "3: addq 1,%2\n" \ "3: addq 1,%2\n", \ " clear.b [%0+]\n", \ " .dword 2b,3b\n") " .dword 2b,3b\n") #define __asm_copy_from_user_2x_cont(to, from, ret, COPY, FIXUP, TENTRY) \ #define __asm_copy_from_user_2x_cont(to, from, ret, COPY, FIXUP, TENTRY) \ __asm_copy_user_cont(to, from, ret, \ __asm_copy_user_cont(to, from, ret, \ " move.w [%1+],$r9\n" \ " move.w [%1+],$r9\n" \ "2: move.w $r9,[%0+]\n" COPY, \ "2: move.w $r9,[%0+]\n" COPY, \ "3: addq 2,%2\n" \ "3: addq 2,%2\n" FIXUP, \ " clear.w [%0+]\n" FIXUP, \ " .dword 2b,3b\n" TENTRY) " .dword 2b,3b\n" TENTRY) #define __asm_copy_from_user_2(to, from, ret) \ #define __asm_copy_from_user_2(to, from, ret) \ Loading @@ -191,16 +189,14 @@ __do_strncpy_from_user(char *dst, const char *src, long count) __asm_copy_from_user_2x_cont(to, from, ret, \ __asm_copy_from_user_2x_cont(to, from, ret, \ " move.b [%1+],$r9\n" \ " move.b [%1+],$r9\n" \ "4: move.b $r9,[%0+]\n", \ "4: move.b $r9,[%0+]\n", \ "5: addq 1,%2\n" \ "5: addq 1,%2\n", \ " clear.b [%0+]\n", \ " .dword 4b,5b\n") " .dword 4b,5b\n") #define __asm_copy_from_user_4x_cont(to, from, ret, COPY, FIXUP, TENTRY) \ #define __asm_copy_from_user_4x_cont(to, from, ret, COPY, FIXUP, TENTRY) \ __asm_copy_user_cont(to, from, ret, \ __asm_copy_user_cont(to, from, ret, \ " move.d [%1+],$r9\n" \ " move.d [%1+],$r9\n" \ "2: move.d $r9,[%0+]\n" COPY, \ "2: move.d $r9,[%0+]\n" COPY, \ "3: addq 4,%2\n" \ "3: addq 4,%2\n" FIXUP, \ " clear.d [%0+]\n" FIXUP, \ " .dword 2b,3b\n" TENTRY) " .dword 2b,3b\n" TENTRY) #define __asm_copy_from_user_4(to, from, ret) \ #define __asm_copy_from_user_4(to, from, ret) \ Loading arch/cris/include/arch-v32/arch/uaccess.h +4 −8 Original line number Original line Diff line number Diff line Loading @@ -178,8 +178,7 @@ __do_strncpy_from_user(char *dst, const char *src, long count) "2: move.b [%1+],$acr\n" \ "2: move.b [%1+],$acr\n" \ " move.b $acr,[%0+]\n", \ " move.b $acr,[%0+]\n", \ "3: addq 1,%2\n" \ "3: addq 1,%2\n" \ " jump 1b\n" \ " jump 1b\n", \ " clear.b [%0+]\n", \ " .dword 2b,3b\n") " .dword 2b,3b\n") #define __asm_copy_from_user_2x_cont(to, from, ret, COPY, FIXUP, TENTRY) \ #define __asm_copy_from_user_2x_cont(to, from, ret, COPY, FIXUP, TENTRY) \ Loading @@ -189,8 +188,7 @@ __do_strncpy_from_user(char *dst, const char *src, long count) " move.w $acr,[%0+]\n", \ " move.w $acr,[%0+]\n", \ FIXUP \ FIXUP \ "3: addq 2,%2\n" \ "3: addq 2,%2\n" \ " jump 1b\n" \ " jump 1b\n", \ " clear.w [%0+]\n", \ TENTRY \ TENTRY \ " .dword 2b,3b\n") " .dword 2b,3b\n") Loading @@ -201,8 +199,7 @@ __do_strncpy_from_user(char *dst, const char *src, long count) __asm_copy_from_user_2x_cont(to, from, ret, \ __asm_copy_from_user_2x_cont(to, from, ret, \ "4: move.b [%1+],$acr\n" \ "4: move.b [%1+],$acr\n" \ " move.b $acr,[%0+]\n", \ " move.b $acr,[%0+]\n", \ "5: addq 1,%2\n" \ "5: addq 1,%2\n", \ " clear.b [%0+]\n", \ " .dword 4b,5b\n") " .dword 4b,5b\n") #define __asm_copy_from_user_4x_cont(to, from, ret, COPY, FIXUP, TENTRY) \ #define __asm_copy_from_user_4x_cont(to, from, ret, COPY, FIXUP, TENTRY) \ Loading @@ -212,8 +209,7 @@ __do_strncpy_from_user(char *dst, const char *src, long count) " move.d $acr,[%0+]\n", \ " move.d $acr,[%0+]\n", \ FIXUP \ FIXUP \ "3: addq 4,%2\n" \ "3: addq 4,%2\n" \ " jump 1b\n" \ " jump 1b\n", \ " clear.d [%0+]\n", \ TENTRY \ TENTRY \ " .dword 2b,3b\n") " .dword 2b,3b\n") Loading Loading
arch/cris/arch-v10/lib/usercopy.c +6 −18 Original line number Original line Diff line number Diff line Loading @@ -217,19 +217,17 @@ unsigned long __copy_user_zeroing(void *pdst, const void __user *psrc, { { __asm_copy_from_user_1 (dst, src, retn); __asm_copy_from_user_1 (dst, src, retn); n--; n--; if (retn) goto exception; } } if (((unsigned long) src & 2) && n >= 2) if (((unsigned long) src & 2) && n >= 2) { { __asm_copy_from_user_2 (dst, src, retn); __asm_copy_from_user_2 (dst, src, retn); n -= 2; n -= 2; if (retn) goto exception; } } /* We only need one check after the unalignment-adjustments, because if both adjustments were done, either both or neither reference had an exception. */ if (retn != 0) goto copy_exception_bytes; } } /* Decide which copying method to use. */ /* Decide which copying method to use. */ Loading Loading @@ -328,7 +326,7 @@ unsigned long __copy_user_zeroing(void *pdst, const void __user *psrc, n -= 4; n -= 4; if (retn) if (retn) goto copy_exception_bytes; goto exception; } } /* If we get here, there were no memory read faults. */ /* If we get here, there were no memory read faults. */ Loading Loading @@ -356,17 +354,7 @@ unsigned long __copy_user_zeroing(void *pdst, const void __user *psrc, bytes. */ bytes. */ return retn; return retn; copy_exception_bytes: exception: /* We already have "retn" bytes cleared, and need to clear the remaining "n" bytes. A non-optimized simple byte-for-byte in-line memset is preferred here, since this isn't speed-critical code and we'd rather have this a leaf-function than calling memset. */ { char *endp; for (endp = dst + n; dst < endp; dst++) *dst = 0; } return retn + n; return retn + n; } } EXPORT_SYMBOL(__copy_user_zeroing); EXPORT_SYMBOL(__copy_user_zeroing); Loading
arch/cris/arch-v32/lib/usercopy.c +6 −17 Original line number Original line Diff line number Diff line Loading @@ -184,19 +184,18 @@ unsigned long __copy_user_zeroing(void *pdst, const void __user *psrc, { { __asm_copy_from_user_1 (dst, src, retn); __asm_copy_from_user_1 (dst, src, retn); n--; n--; if (retn != 0) goto exception; } } if (((unsigned long) src & 2) && n >= 2) if (((unsigned long) src & 2) && n >= 2) { { __asm_copy_from_user_2 (dst, src, retn); __asm_copy_from_user_2 (dst, src, retn); n -= 2; n -= 2; if (retn != 0) goto exception; } } /* We only need one check after the unalignment-adjustments, because if both adjustments were done, either both or neither reference had an exception. */ if (retn != 0) goto copy_exception_bytes; } } /* Movem is dirt cheap. The overheap is low enough to always use the /* Movem is dirt cheap. The overheap is low enough to always use the Loading Loading @@ -279,7 +278,7 @@ unsigned long __copy_user_zeroing(void *pdst, const void __user *psrc, n -= 4; n -= 4; if (retn) if (retn) goto copy_exception_bytes; goto exception; } } /* If we get here, there were no memory read faults. */ /* If we get here, there were no memory read faults. */ Loading Loading @@ -307,17 +306,7 @@ unsigned long __copy_user_zeroing(void *pdst, const void __user *psrc, bytes. */ bytes. */ return retn; return retn; copy_exception_bytes: exception: /* We already have "retn" bytes cleared, and need to clear the remaining "n" bytes. A non-optimized simple byte-for-byte in-line memset is preferred here, since this isn't speed-critical code and we'd rather have this a leaf-function than calling memset. */ { char *endp; for (endp = dst + n; dst < endp; dst++) *dst = 0; } return retn + n; return retn + n; } } EXPORT_SYMBOL(__copy_user_zeroing); EXPORT_SYMBOL(__copy_user_zeroing); Loading
arch/cris/include/arch-v10/arch/uaccess.h +4 −8 Original line number Original line Diff line number Diff line Loading @@ -172,16 +172,14 @@ __do_strncpy_from_user(char *dst, const char *src, long count) __asm_copy_user_cont(to, from, ret, \ __asm_copy_user_cont(to, from, ret, \ " move.b [%1+],$r9\n" \ " move.b [%1+],$r9\n" \ "2: move.b $r9,[%0+]\n", \ "2: move.b $r9,[%0+]\n", \ "3: addq 1,%2\n" \ "3: addq 1,%2\n", \ " clear.b [%0+]\n", \ " .dword 2b,3b\n") " .dword 2b,3b\n") #define __asm_copy_from_user_2x_cont(to, from, ret, COPY, FIXUP, TENTRY) \ #define __asm_copy_from_user_2x_cont(to, from, ret, COPY, FIXUP, TENTRY) \ __asm_copy_user_cont(to, from, ret, \ __asm_copy_user_cont(to, from, ret, \ " move.w [%1+],$r9\n" \ " move.w [%1+],$r9\n" \ "2: move.w $r9,[%0+]\n" COPY, \ "2: move.w $r9,[%0+]\n" COPY, \ "3: addq 2,%2\n" \ "3: addq 2,%2\n" FIXUP, \ " clear.w [%0+]\n" FIXUP, \ " .dword 2b,3b\n" TENTRY) " .dword 2b,3b\n" TENTRY) #define __asm_copy_from_user_2(to, from, ret) \ #define __asm_copy_from_user_2(to, from, ret) \ Loading @@ -191,16 +189,14 @@ __do_strncpy_from_user(char *dst, const char *src, long count) __asm_copy_from_user_2x_cont(to, from, ret, \ __asm_copy_from_user_2x_cont(to, from, ret, \ " move.b [%1+],$r9\n" \ " move.b [%1+],$r9\n" \ "4: move.b $r9,[%0+]\n", \ "4: move.b $r9,[%0+]\n", \ "5: addq 1,%2\n" \ "5: addq 1,%2\n", \ " clear.b [%0+]\n", \ " .dword 4b,5b\n") " .dword 4b,5b\n") #define __asm_copy_from_user_4x_cont(to, from, ret, COPY, FIXUP, TENTRY) \ #define __asm_copy_from_user_4x_cont(to, from, ret, COPY, FIXUP, TENTRY) \ __asm_copy_user_cont(to, from, ret, \ __asm_copy_user_cont(to, from, ret, \ " move.d [%1+],$r9\n" \ " move.d [%1+],$r9\n" \ "2: move.d $r9,[%0+]\n" COPY, \ "2: move.d $r9,[%0+]\n" COPY, \ "3: addq 4,%2\n" \ "3: addq 4,%2\n" FIXUP, \ " clear.d [%0+]\n" FIXUP, \ " .dword 2b,3b\n" TENTRY) " .dword 2b,3b\n" TENTRY) #define __asm_copy_from_user_4(to, from, ret) \ #define __asm_copy_from_user_4(to, from, ret) \ Loading
arch/cris/include/arch-v32/arch/uaccess.h +4 −8 Original line number Original line Diff line number Diff line Loading @@ -178,8 +178,7 @@ __do_strncpy_from_user(char *dst, const char *src, long count) "2: move.b [%1+],$acr\n" \ "2: move.b [%1+],$acr\n" \ " move.b $acr,[%0+]\n", \ " move.b $acr,[%0+]\n", \ "3: addq 1,%2\n" \ "3: addq 1,%2\n" \ " jump 1b\n" \ " jump 1b\n", \ " clear.b [%0+]\n", \ " .dword 2b,3b\n") " .dword 2b,3b\n") #define __asm_copy_from_user_2x_cont(to, from, ret, COPY, FIXUP, TENTRY) \ #define __asm_copy_from_user_2x_cont(to, from, ret, COPY, FIXUP, TENTRY) \ Loading @@ -189,8 +188,7 @@ __do_strncpy_from_user(char *dst, const char *src, long count) " move.w $acr,[%0+]\n", \ " move.w $acr,[%0+]\n", \ FIXUP \ FIXUP \ "3: addq 2,%2\n" \ "3: addq 2,%2\n" \ " jump 1b\n" \ " jump 1b\n", \ " clear.w [%0+]\n", \ TENTRY \ TENTRY \ " .dword 2b,3b\n") " .dword 2b,3b\n") Loading @@ -201,8 +199,7 @@ __do_strncpy_from_user(char *dst, const char *src, long count) __asm_copy_from_user_2x_cont(to, from, ret, \ __asm_copy_from_user_2x_cont(to, from, ret, \ "4: move.b [%1+],$acr\n" \ "4: move.b [%1+],$acr\n" \ " move.b $acr,[%0+]\n", \ " move.b $acr,[%0+]\n", \ "5: addq 1,%2\n" \ "5: addq 1,%2\n", \ " clear.b [%0+]\n", \ " .dword 4b,5b\n") " .dword 4b,5b\n") #define __asm_copy_from_user_4x_cont(to, from, ret, COPY, FIXUP, TENTRY) \ #define __asm_copy_from_user_4x_cont(to, from, ret, COPY, FIXUP, TENTRY) \ Loading @@ -212,8 +209,7 @@ __do_strncpy_from_user(char *dst, const char *src, long count) " move.d $acr,[%0+]\n", \ " move.d $acr,[%0+]\n", \ FIXUP \ FIXUP \ "3: addq 4,%2\n" \ "3: addq 4,%2\n" \ " jump 1b\n" \ " jump 1b\n", \ " clear.d [%0+]\n", \ TENTRY \ TENTRY \ " .dword 2b,3b\n") " .dword 2b,3b\n") Loading