summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-01-03 22:36:53 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-01-03 22:36:53 +0000
commitc1c3f7d4468f02adbf8ced689d738386e42af773 (patch)
tree915f467bdb1c6c92415b4e56e6be9bedb42a3eee /libc
parent3b36564b18d83ec313fd2aa6d7f38576dea3f6b8 (diff)
parentc5bf703c4cfa2ca4f35a83c9afaf4ee123cb617c (diff)
downloadbionic-c1c3f7d4468f02adbf8ced689d738386e42af773.zip
bionic-c1c3f7d4468f02adbf8ced689d738386e42af773.tar.gz
bionic-c1c3f7d4468f02adbf8ced689d738386e42af773.tar.bz2
Merge "Remove as many hard-coded constants from the MIPS vfork.S as possible."
Diffstat (limited to 'libc')
-rw-r--r--libc/arch-mips/bionic/vfork.S24
1 files changed, 16 insertions, 8 deletions
diff --git a/libc/arch-mips/bionic/vfork.S b/libc/arch-mips/bionic/vfork.S
index 2e2e4ff..414caaf 100644
--- a/libc/arch-mips/bionic/vfork.S
+++ b/libc/arch-mips/bionic/vfork.S
@@ -27,10 +27,13 @@
*/
#include <asm/unistd.h>
+#include <linux/sched.h>
- .text
+// TODO: mips' uapi signal.h is missing #ifndef __ASSEMBLY__.
+// #include <asm/signal.h>
+#define SIGCHLD 18
-/* int vfork() implemented using clone() */
+ .text
.type vfork, @function
.global vfork
@@ -40,17 +43,22 @@ vfork:
.set noreorder
.cpload $t9
- li $a0, 0x4112 /* CLONE_VM | CLONE_VFORK | SIGCHLD */
- move $a1, $sp
+ li $a0, (CLONE_VM | CLONE_VFORK | SIGCHLD)
+ li $a1, 0
+ li $a2, 0
+ li $a3, 0
+ subu $sp, 8
+ sw $0, 16($sp)
li $v0, __NR_clone
syscall
- bnez $a3,1f
- nop
+ addu $sp, 8
+ bnez $a3, 1f
+ move $a0, $v0
j $ra
nop
1:
- la $t9,__set_errno
+ la $t9, __set_errno
j $t9
- move $a0,$v0
+ nop
.end vfork