diff options
author | David 'Digit' Turner <digit@google.com> | 2010-01-22 18:59:05 -0800 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2010-01-25 11:18:30 -0800 |
commit | 97cf7f3394780d524038fc083e2c134031b54728 (patch) | |
tree | 40b61956bbe4d28babe839c3be40e9f114810e5f /libc/arch-sh | |
parent | 1a2917ca954f575cc9698c99e54bd93087793c8f (diff) | |
download | bionic-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-sh')
-rw-r--r-- | libc/arch-sh/bionic/clone.S | 5 | ||||
-rw-r--r-- | libc/arch-sh/syscalls.mk | 2 | ||||
-rw-r--r-- | libc/arch-sh/syscalls/__sys_clone.S (renamed from libc/arch-sh/syscalls/__clone.S) | 11 |
3 files changed, 13 insertions, 5 deletions
diff --git a/libc/arch-sh/bionic/clone.S b/libc/arch-sh/bionic/clone.S index 0bbaecb..9cb19ee 100644 --- a/libc/arch-sh/bionic/clone.S +++ b/libc/arch-sh/bionic/clone.S @@ -72,3 +72,8 @@ __return: .align 2 0: .long __NR_clone 1: .long __thread_entry + +/* XXX: TODO: Add __bionic_clone here + * See bionic/bionic_clone.c and arch-arm/bionic/clone.S + * for more details... + */
\ No newline at end of file diff --git a/libc/arch-sh/syscalls.mk b/libc/arch-sh/syscalls.mk index cefb2ec..d3e531e 100644 --- a/libc/arch-sh/syscalls.mk +++ b/libc/arch-sh/syscalls.mk @@ -5,7 +5,7 @@ syscall_src += arch-sh/syscalls/_exit_thread.S syscall_src += arch-sh/syscalls/__fork.S syscall_src += arch-sh/syscalls/_waitpid.S syscall_src += arch-sh/syscalls/waitid.S -syscall_src += arch-sh/syscalls/__clone.S +syscall_src += arch-sh/syscalls/__sys_clone.S syscall_src += arch-sh/syscalls/execve.S syscall_src += arch-sh/syscalls/setuid.S syscall_src += arch-sh/syscalls/getuid.S diff --git a/libc/arch-sh/syscalls/__clone.S b/libc/arch-sh/syscalls/__sys_clone.S index 1df6ca2..c2e7dd2 100644 --- a/libc/arch-sh/syscalls/__clone.S +++ b/libc/arch-sh/syscalls/__sys_clone.S @@ -2,15 +2,18 @@ #include <sys/linux-syscalls.h> .text - .type __clone, @function - .globl __clone + .type __sys_clone, @function + .globl __sys_clone .align 4 -__clone: +__sys_clone: + + /* get ready for additonal arg */ + mov.l @r15, r0 /* invoke trap */ mov.l 0f, r3 /* trap num */ - trapa #(4 + 0x10) + trapa #(5 + 0x10) /* check return value */ cmp/pz r0 |