arm64: lib: use pair accessors for copy_*_user routines
[linux-2.6-microblaze.git] / arch / arm64 / lib / copy_to_user.S
index a0aeeb9..f5e1f52 100644 (file)
  *     x0 - bytes not copied
  */
 ENTRY(__copy_to_user)
-       add     x4, x0, x2                      // upper user buffer boundary
-       subs    x2, x2, #8
+       add     x5, x0, x2                      // upper user buffer boundary
+       subs    x2, x2, #16
+       b.mi    1f
+0:
+       ldp     x3, x4, [x1], #16
+       subs    x2, x2, #16
+USER(9f, stp   x3, x4, [x0], #16)
+       b.pl    0b
+1:     adds    x2, x2, #8
        b.mi    2f
-1:
        ldr     x3, [x1], #8
-       subs    x2, x2, #8
+       sub     x2, x2, #8
 USER(9f, str   x3, [x0], #8    )
-       b.pl    1b
 2:     adds    x2, x2, #4
        b.mi    3f
        ldr     w3, [x1], #4
@@ -56,6 +61,6 @@ ENDPROC(__copy_to_user)
 
        .section .fixup,"ax"
        .align  2
-9:     sub     x0, x4, x0                      // bytes not copied
+9:     sub     x0, x5, x0                      // bytes not copied
        ret
        .previous