OSDN Git Service

Replace FSF snail mail address with URLs
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / arm / clone.S
index d948373..33b1041 100644 (file)
@@ -13,9 +13,8 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 /* clone() is even more special than fork() as it mucks with stacks
    and invokes a function in the right context after its all over.  */
 /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
 
 .text
-.global clone
-.type clone,%function
+.global __clone
+.type __clone,%function
 .align 2
 #if defined(THUMB1_ONLY)
 .thumb_func
-clone:
+__clone:
        @ sanity check args
        cmp     r0, #0
        beq     __einval
@@ -52,9 +51,15 @@ clone:
        @ get flags
        mov     r0, r2
        @ new sp is already in r1
+       @ load remaining arguments off the stack
+       stmfd   sp!, {r4}
+       ldr     r2, [sp, #4]
+       ldr     r3, [sp, #8]
+       ldr     r4, [sp, #12]
        DO_CALL (clone)
        movs    a1, a1
        blt     __error
+       ldmnefd sp!, {r4}
        beq     1f
        bx      lr
 1:
@@ -80,7 +85,7 @@ __error:
        POP_RET
 .pool
 #else
-clone:
+__clone:
        @ sanity check args
        cmp     r0, #0
        IT(te, ne)
@@ -98,9 +103,15 @@ clone:
        @ get flags
        mov     r0, r2
        @ new sp is already in r1
+       @ load remaining arguments off the stack
+       stmfd   sp!, {r4}
+       ldr     r2, [sp, #4]
+       ldr     r3, [sp, #8]
+       ldr     r4, [sp, #12]
        DO_CALL (clone)
        movs    a1, a1
        blt     __error
+       ldmnefd sp!, {r4}
        IT(t, ne)
 #if defined(__USE_BX__)
        bxne    lr
@@ -120,6 +131,7 @@ __error:
        b       __syscall_error
 #endif
 
-.size clone,.-clone
+.size __clone,.-__clone
+weak_alias(__clone, clone)
 
 #endif