am 3fcc90c6
: am c1c3f7d4
: Merge "Remove as many hard-coded constants from the MIPS vfork.S as possible."
* commit '3fcc90c6c0ed602aeaa51b592e7d8effdae74cc8': Remove as many hard-coded constants from the MIPS vfork.S as possible.
This commit is contained in:
commit
dd18a8dfd0
@ -27,11 +27,14 @@
|
||||
*/
|
||||
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
// TODO: mips' uapi signal.h is missing #ifndef __ASSEMBLY__.
|
||||
// #include <asm/signal.h>
|
||||
#define SIGCHLD 18
|
||||
|
||||
.text
|
||||
|
||||
/* int vfork() implemented using clone() */
|
||||
|
||||
.type vfork, @function
|
||||
.global vfork
|
||||
.align 4
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user