summaryrefslogtreecommitdiffstats
path: root/libc/arch-arm/syscalls
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2010-01-22 18:59:05 -0800
committerDavid 'Digit' Turner <digit@google.com>2010-01-25 11:18:30 -0800
commit97cf7f3394780d524038fc083e2c134031b54728 (patch)
tree40b61956bbe4d28babe839c3be40e9f114810e5f /libc/arch-arm/syscalls
parent1a2917ca954f575cc9698c99e54bd93087793c8f (diff)
downloadbionic-97cf7f3394780d524038fc083e2c134031b54728.zip
bionic-97cf7f3394780d524038fc083e2c134031b54728.tar.gz
bionic-97cf7f3394780d524038fc083e2c134031b54728.tar.bz2
Implement clone() C library function properly.
Only provide an implementation for ARM at the moment, since it requires specific assembly fragments (the standard syscall stubs cannot be used because the child returns in a different stack).
Diffstat (limited to 'libc/arch-arm/syscalls')
-rw-r--r--libc/arch-arm/syscalls/__sys_clone.S (renamed from libc/arch-arm/syscalls/__clone.S)14
1 files changed, 8 insertions, 6 deletions
diff --git a/libc/arch-arm/syscalls/__clone.S b/libc/arch-arm/syscalls/__sys_clone.S
index 650e2c0..9fe2641 100644
--- a/libc/arch-arm/syscalls/__clone.S
+++ b/libc/arch-arm/syscalls/__sys_clone.S
@@ -2,17 +2,19 @@
#include <sys/linux-syscalls.h>
.text
- .type __clone, #function
- .globl __clone
+ .type __sys_clone, #function
+ .globl __sys_clone
.align 4
.fnstart
-__clone:
- .save {r4, r7}
- stmfd sp!, {r4, r7}
+__sys_clone:
+ mov ip, sp
+ .save {r4, r5, r6, r7}
+ stmfd sp!, {r4, r5, r6, r7}
+ ldmfd ip, {r4, r5, r6}
ldr r7, =__NR_clone
swi #0
- ldmfd sp!, {r4, r7}
+ ldmfd sp!, {r4, r5, r6, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno