chiark / gitweb /
volume_id: provide libvolume_id.a file
[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         .align 32
23         .proc vfork
24         .global vfork
25 vfork:  
26         alloc r2=ar.pfs,0,0,2,0
27         mov     r15=__NR_clone
28         mov     out0=CLONE_VM|CLONE_VFORK|SIGCHLD
29         mov     out1=0
30         ;;
31         break 0x100000      // Do the syscall
32         ;; 
33         addl    r15=0,r1
34         cmp.eq  p7,p6 = -1,r10
35         ;;
36         ld8     r14=[r15]
37         ;;
38 (p7)    st4     [r14]=r8
39         ;; 
40 (p7)    mov     r8=-1
41         br.ret.sptk.many b0
42         .endp vfork