OSDN Git Service

4b701f7ff0115205bbffb7dea2e0f6cca44b583c
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / sparc / vfork.S
1 /* Copyright (C) 1999 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
3    Contributed by Jakub Jelinek <jj@ultra.linux.cz>, 1999.
4
5    The GNU C Library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public
7    License as published by the Free Software Foundation; either
8    version 2.1 of the License, or (at your option) any later version.
9
10    The GNU C Library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Lesser General Public License for more details.
14
15    You should have received a copy of the GNU Lesser General Public
16    License along with the GNU C Library; if not, see
17    <http://www.gnu.org/licenses/>.  */
18
19 /* Code taken from glibc2.2.2/sysdeps/unix/sysv/linux/sparc/vfork.S */
20
21 #include <sys/syscall.h>
22
23 #ifndef __NR_vfork
24 /* No vfork so use fork instead */
25 # define __NR_vfork __NR_fork
26 #endif
27
28 .text
29 .global __vfork
30 .hidden __vfork
31 .type   __vfork,%function
32 .align 4
33
34 __vfork:
35         mov __NR_vfork, %g1
36         ta      0x10
37         bcc,a   9000f
38         nop
39         save    %sp,-96,%sp
40         call HIDDEN_JUMPTARGET(__errno_location)
41         nop
42         st      %i0,[%o0]
43         jmpl    %i7+8,%g0
44         restore %g0,-1,%o0
45
46 9000:
47         sub     %o1, 1, %o1
48         retl
49         and     %o0, %o1, %o0
50
51 .size __vfork,.-__vfork
52
53 weak_alias(__vfork,vfork)
54 libc_hidden_def(vfork)