[ARM] 2946/2: split --arch_clear_user() out of lib/uaccess.S
authorNicolas Pitre <nico@cam.org>
Tue, 1 Nov 2005 19:52:22 +0000 (19:52 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 1 Nov 2005 19:52:22 +0000 (19:52 +0000)
Patch from Nicolas Pitre

Required for future enhancement patches.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/lib/Makefile
arch/arm/lib/clear_user.S [new file with mode: 0644]
arch/arm/lib/uaccess.S

index 71e5b99e519ea07c0969ea8ae38e57e8b6f0bf9e..d3d9b21eb7e4b9e34c5bdb51af91edca06627f73 100644 (file)
@@ -9,8 +9,9 @@ lib-y           := backtrace.o changebit.o csumipv6.o csumpartial.o   \
                   copy_page.o delay.o findbit.o memchr.o memcpy.o    \
                   memset.o memzero.o setbit.o strncpy_from_user.o    \
                   strnlen_user.o strchr.o strrchr.o testchangebit.o  \
-                  testclearbit.o testsetbit.o uaccess.o getuser.o    \
-                  putuser.o ashldi3.o ashrdi3.o lshrdi3.o muldi3.o   \
+                  testclearbit.o testsetbit.o uaccess.o              \
+                  getuser.o putuser.o clear_user.o                   \
+                  ashldi3.o ashrdi3.o lshrdi3.o muldi3.o             \
                   ucmpdi2.o lib1funcs.o div64.o sha1.o               \
                   io-readsb.o io-writesb.o io-readsl.o io-writesl.o
 
diff --git a/arch/arm/lib/clear_user.S b/arch/arm/lib/clear_user.S
new file mode 100644 (file)
index 0000000..7ff9f83
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ *  linux/arch/arm/lib/clear_user.S
+ *
+ *  Copyright (C) 1995, 1996,1997,1998 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/linkage.h>
+#include <asm/assembler.h>
+
+               .text
+
+/* Prototype: int __arch_clear_user(void *addr, size_t sz)
+ * Purpose  : clear some user memory
+ * Params   : addr - user memory address to clear
+ *          : sz   - number of bytes to clear
+ * Returns  : number of bytes NOT cleared
+ */
+ENTRY(__arch_clear_user)
+               stmfd   sp!, {r1, lr}
+               mov     r2, #0
+               cmp     r1, #4
+               blt     2f
+               ands    ip, r0, #3
+               beq     1f
+               cmp     ip, #2
+USER(          strbt   r2, [r0], #1)
+USER(          strlebt r2, [r0], #1)
+USER(          strltbt r2, [r0], #1)
+               rsb     ip, ip, #4
+               sub     r1, r1, ip              @  7  6  5  4  3  2  1
+1:             subs    r1, r1, #8              @ -1 -2 -3 -4 -5 -6 -7
+USER(          strplt  r2, [r0], #4)
+USER(          strplt  r2, [r0], #4)
+               bpl     1b
+               adds    r1, r1, #4              @  3  2  1  0 -1 -2 -3
+USER(          strplt  r2, [r0], #4)
+2:             tst     r1, #2                  @ 1x 1x 0x 0x 1x 1x 0x
+USER(          strnebt r2, [r0], #1)
+USER(          strnebt r2, [r0], #1)
+               tst     r1, #1                  @ x1 x0 x1 x0 x1 x0 x1
+USER(          strnebt r2, [r0], #1)
+               mov     r0, #0
+               LOADREGS(fd,sp!, {r1, pc})
+
+               .section .fixup,"ax"
+               .align  0
+9001:          LOADREGS(fd,sp!, {r0, pc})
+               .previous
+
index d3ed0636c00859e3f5e9c34d916981b4d42a36ad..c28449157beacb33d16f562b105e6c69a2e3652a 100644 (file)
@@ -657,41 +657,3 @@ USER(              ldrgtbt r3, [r1], #1)                   @ May fault
                LOADREGS(fd,sp!, {r4 - r7, pc})
                .previous
 
-/* Prototype: int __arch_clear_user(void *addr, size_t sz)
- * Purpose  : clear some user memory
- * Params   : addr - user memory address to clear
- *          : sz   - number of bytes to clear
- * Returns  : number of bytes NOT cleared
- */
-ENTRY(__arch_clear_user)
-               stmfd   sp!, {r1, lr}
-               mov     r2, #0
-               cmp     r1, #4
-               blt     2f
-               ands    ip, r0, #3
-               beq     1f
-               cmp     ip, #2
-USER(          strbt   r2, [r0], #1)
-USER(          strlebt r2, [r0], #1)
-USER(          strltbt r2, [r0], #1)
-               rsb     ip, ip, #4
-               sub     r1, r1, ip              @  7  6  5  4  3  2  1
-1:             subs    r1, r1, #8              @ -1 -2 -3 -4 -5 -6 -7
-USER(          strplt  r2, [r0], #4)
-USER(          strplt  r2, [r0], #4)
-               bpl     1b
-               adds    r1, r1, #4              @  3  2  1  0 -1 -2 -3
-USER(          strplt  r2, [r0], #4)
-2:             tst     r1, #2                  @ 1x 1x 0x 0x 1x 1x 0x
-USER(          strnebt r2, [r0], #1)
-USER(          strnebt r2, [r0], #1)
-               tst     r1, #1                  @ x1 x0 x1 x0 x1 x0 x1
-USER(          strnebt r2, [r0], #1)
-               mov     r0, #0
-               LOADREGS(fd,sp!, {r1, pc})
-
-               .section .fixup,"ax"
-               .align  0
-9001:          LOADREGS(fd,sp!, {r0, pc})
-               .previous
-