chiark / gitweb /
efcd03f7f1b0f5ef3a39849dbbcf46899de3c03f
[elogind.git] / klibc / klibc / arch / ia64 / vfork.S
1 /*
2  * ia64 specific vfork syscall
3  *
4  * Written By:   Martin Hicks <mort@wildopensource.com>
5  *
6  */
7
8 /* This syscall is a special case of the clone syscall */
9 #include <asm/unistd.h>
10 #include <asm/signal.h>
11 #include <klibc/archsys.h>
12
13 /* These are redefined here because linux/sched.h isn't safe for
14  * inclusion in asm.
15  */
16 #define CLONE_VM    0x00000100 /* set if VM shared between processes */
17 #define CLONE_VFORK 0x00004000 /* set if parent wants the child to wake it up on exit */
18         
19 /* pid_t vfork(void) */
20 /* Implemented as clone(CLONE_VFORK | CLONE_VM | SIGCHLD, 0) */
21
22         .proc vfork
23         .global vfork
24 vfork:  
25         alloc r2=ar.pfs,0,0,2,0
26         mov     r15=__NR_clone
27         mov     out0=CLONE_VM|CLONE_VFORK|SIGCHLD
28         mov     out1=0
29         ;;
30         break 0x100000      // Do the syscall
31         ;; 
32         addl    r15=0,r1
33         cmp.eq  p7,p6 = -1,r10
34         ;;
35         ld8     r14=[r15]
36         ;;
37 (p7)    st4     [r14]=r8
38         ;; 
39 (p7)    mov     r8=-1
40         br.ret.sptk.many b0
41         .endp