m68k: Use generic strncpy_from_user(), strlen_user(), and strnlen_user()
[deliverable/linux.git] / arch / m68k / lib / uaccess.c
index 5664386338da851094d48191ac1f717aa5dfff69..5e97f2ee7c1197feaf1fb79ec07cd10566466026 100644 (file)
@@ -103,80 +103,6 @@ unsigned long __generic_copy_to_user(void __user *to, const void *from,
 }
 EXPORT_SYMBOL(__generic_copy_to_user);
 
-/*
- * Copy a null terminated string from userspace.
- */
-long strncpy_from_user(char *dst, const char __user *src, long count)
-{
-       long res;
-       char c;
-
-       if (count <= 0)
-               return count;
-
-       asm volatile ("\n"
-               "1:     "MOVES".b       (%2)+,%4\n"
-               "       move.b  %4,(%1)+\n"
-               "       jeq     2f\n"
-               "       subq.l  #1,%3\n"
-               "       jne     1b\n"
-               "2:     sub.l   %3,%0\n"
-               "3:\n"
-               "       .section .fixup,\"ax\"\n"
-               "       .even\n"
-               "10:    move.l  %5,%0\n"
-               "       jra     3b\n"
-               "       .previous\n"
-               "\n"
-               "       .section __ex_table,\"a\"\n"
-               "       .align  4\n"
-               "       .long   1b,10b\n"
-               "       .previous"
-               : "=d" (res), "+a" (dst), "+a" (src), "+r" (count), "=&d" (c)
-               : "i" (-EFAULT), "0" (count));
-
-       return res;
-}
-EXPORT_SYMBOL(strncpy_from_user);
-
-/*
- * Return the size of a string (including the ending 0)
- *
- * Return 0 on exception, a value greater than N if too long
- */
-long strnlen_user(const char __user *src, long n)
-{
-       char c;
-       long res;
-
-       asm volatile ("\n"
-               "1:     subq.l  #1,%1\n"
-               "       jmi     3f\n"
-               "2:     "MOVES".b       (%0)+,%2\n"
-               "       tst.b   %2\n"
-               "       jne     1b\n"
-               "       jra     4f\n"
-               "\n"
-               "3:     addq.l  #1,%0\n"
-               "4:     sub.l   %4,%0\n"
-               "5:\n"
-               "       .section .fixup,\"ax\"\n"
-               "       .even\n"
-               "20:    sub.l   %0,%0\n"
-               "       jra     5b\n"
-               "       .previous\n"
-               "\n"
-               "       .section __ex_table,\"a\"\n"
-               "       .align  4\n"
-               "       .long   2b,20b\n"
-               "       .previous\n"
-               : "=&a" (res), "+d" (n), "=&d" (c)
-               : "0" (src), "r" (src));
-
-       return res;
-}
-EXPORT_SYMBOL(strnlen_user);
-
 /*
  * Zero Userspace
  */
This page took 0.03147 seconds and 5 git commands to generate.