chiark / gitweb /
[PATCH] update klibc to version 0.181
[elogind.git] / klibc / klibc / arch / sparc64 / sysfork.S
1 /*
2  * arch/sparc64/sysfork.S
3  *
4  * The fork and vfork system calls are special on sparc[64]:
5  * they return the "other process" pid in %o0 and the
6  * "is child" flag in %o1
7  *
8  * Common system-call stub; %g1 already set to syscall number
9  *
10  * IS THIS CORRECT FOR SPARC64?
11  */
12
13         .globl  __syscall_forkish
14         .type   __syscall_forkish,#function
15         .align  4
16 __syscall_forkish:
17         t       0x6d
18         sub     %o1, 1, %o1
19         bcc,a   %xcc, 1f
20           and   %o0, %o1, %o0
21         sethi   %hi(errno), %g4
22         or      %g4, %lo(errno), %g4
23         st      %o0,[%g4]
24 1:
25         retl
26           movcs %xcc, -1, %o0