From d3a4a571c42d14ad2dfbe8c06bdf02b74d012e94 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 10 Mar 2004 19:28:58 +0000 Subject: Update. 2004-03-10 Jakub Jelinek * include/libc-symbols.h [__ASSEMBLY__] (compat_text_section, compat_data_section): Define. * sysdeps/unix/sysv/linux/alpha/adjtime.c (ADJTIME): Add attribute_compat_text_section. * sysdeps/unix/sysv/linux/alpha/wordexp.c (__old_wordexp): Likewise. * sysdeps/unix/sysv/linux/alpha/oldglob.c (__old_glob, __old_globfree): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/chown.c (__chown_is_lchown): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c (__posix_fadvise64_l32): Likewise. * sysdeps/unix/sysv/linux/msgctl.c (__old_msgctl): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise64.c (__posix_fadvise64_l32): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c (__old_semctl): Likewise. * sysdeps/unix/sysv/linux/semctl.c (__old_semctl): Likewise. * sysdeps/unix/sysv/linux/posix_fadvise64.c (__posix_fadvise64_l32): Likewise. * sysdeps/unix/sysv/linux/shmctl.c (__old_shmctl): Likewise. * hurd/compat-20.c (_hurd_proc_init_compat_20): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S (__swapcontext, __novec_swapcontext): Use END instead of PSEUDO_END. (__novec_swapcontext, __swapcontext_stub): Add compat_text_section. * sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S (__makecontext_stub): Likewise. (__novec_makecontext): Likewise. Fix name in END () to match function name. * sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S (__setcontext): Use END instead of PSEUDO_END. (__novec_setcontext): Add compat_text_section. Use END instead of PSEUDO_END, fix the name in END () to match function name. * sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S (__getcontext, __novec_getcontext): Use END instead of PSEUDO_END. (__novec_getcontext, __getcontext_stub): Add compat_text_section. 2004-03-10 Kaz Kojima * sysdeps/sh/dl-machine.h: Don't use GL macro if not appropriate. (COPY_UNALIGNED_WORD): Remove cast used as lvalue. 2004-03-10 Ulrich Drepper * sysdeps/i386/dl-procinfo.h (HWCAP_IMPORTANT): Remove mmx, add sse2. --- nptl/sysdeps/ia64/tcb-offsets.sym | 1 + nptl/sysdeps/s390/tcb-offsets.sym | 1 + nptl/sysdeps/sparc/tcb-offsets.sym | 1 + nptl/sysdeps/unix/sysv/linux/ia64/pt-vfork.S | 13 ++++- nptl/sysdeps/unix/sysv/linux/ia64/vfork.S | 68 ++++++++++++++++++++++ .../unix/sysv/linux/s390/s390-32/pt-vfork.S | 10 ++++ nptl/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S | 57 ++++++++++++++++++ .../unix/sysv/linux/s390/s390-64/pt-vfork.S | 15 ++++- nptl/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S | 59 +++++++++++++++++++ nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S | 28 --------- .../unix/sysv/linux/sparc/sparc32/pt-vfork.S | 42 +++++++++++++ nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S | 45 ++++++++++++++ .../unix/sysv/linux/sparc/sparc64/pt-vfork.S | 42 +++++++++++++ nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S | 45 ++++++++++++++ 14 files changed, 396 insertions(+), 31 deletions(-) create mode 100644 nptl/sysdeps/unix/sysv/linux/ia64/vfork.S create mode 100644 nptl/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S create mode 100644 nptl/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S delete mode 100644 nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S create mode 100644 nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S create mode 100644 nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S create mode 100644 nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S create mode 100644 nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (limited to 'nptl/sysdeps') diff --git a/nptl/sysdeps/ia64/tcb-offsets.sym b/nptl/sysdeps/ia64/tcb-offsets.sym index 24dc3e9683..09ea70ddc7 100644 --- a/nptl/sysdeps/ia64/tcb-offsets.sym +++ b/nptl/sysdeps/ia64/tcb-offsets.sym @@ -1,5 +1,6 @@ #include #include +PID offsetof (struct pthread, pid) - sizeof (struct pthread) MULTIPLE_THREADS_OFFSET offsetof (struct pthread, header.multiple_threads) - sizeof (struct pthread) SYSINFO_OFFSET offsetof (tcbhead_t, private) diff --git a/nptl/sysdeps/s390/tcb-offsets.sym b/nptl/sysdeps/s390/tcb-offsets.sym index aee6be2570..c6e230a315 100644 --- a/nptl/sysdeps/s390/tcb-offsets.sym +++ b/nptl/sysdeps/s390/tcb-offsets.sym @@ -2,3 +2,4 @@ #include MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads) +PID offsetof (struct pthread, pid) diff --git a/nptl/sysdeps/sparc/tcb-offsets.sym b/nptl/sysdeps/sparc/tcb-offsets.sym index aee6be2570..c6e230a315 100644 --- a/nptl/sysdeps/sparc/tcb-offsets.sym +++ b/nptl/sysdeps/sparc/tcb-offsets.sym @@ -2,3 +2,4 @@ #include MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads) +PID offsetof (struct pthread, pid) diff --git a/nptl/sysdeps/unix/sysv/linux/ia64/pt-vfork.S b/nptl/sysdeps/unix/sysv/linux/ia64/pt-vfork.S index a8e2e492d3..f59227c695 100644 --- a/nptl/sysdeps/unix/sysv/linux/ia64/pt-vfork.S +++ b/nptl/sysdeps/unix/sysv/linux/ia64/pt-vfork.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -32,13 +32,22 @@ ENTRY(__vfork) .prologue // work around a GAS bug which triggers if .body // first .prologue is not at the beginning of proc. - alloc r2=ar.pfs,0,0,2,0 + alloc r2=ar.pfs,0,1,2,0 + adds r14=PID,r13 + ;; + ld4 loc0=[r14] + ;; + sub r15=0,loc0 mov out0=CLONE_VM+CLONE_VFORK+SIGCHLD mov out1=0 /* Standard sp value. */ ;; + st4 [r14]=r15 DO_CALL (SYS_ify (clone)) + cmp.eq p0,p7=0,r8 cmp.eq p6,p0=-1,r10 + adds r14=PID,r13 ;; +(p7) st4 [r14]=loc0 (p6) br.cond.spnt.few __syscall_error ret PSEUDO_END(__vfork) diff --git a/nptl/sysdeps/unix/sysv/linux/ia64/vfork.S b/nptl/sysdeps/unix/sysv/linux/ia64/vfork.S new file mode 100644 index 0000000000..bbb34d94f0 --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/ia64/vfork.S @@ -0,0 +1,68 @@ +/* Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + + +#include +#define _SIGNAL_H +#include +#include + +/* The following are defined in linux/sched.h, which unfortunately */ +/* is not safe for inclusion in an assembly file. */ +#define CLONE_VM 0x00000100 /* set if VM shared between processes */ +#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */ + +/* pid_t vfork(void); */ +/* Implemented as __clone_syscall(CLONE_VFORK | CLONE_VM | SIGCHLD, 0) */ + +ENTRY(__vfork) + alloc r2=ar.pfs,0,0,2,0 + adds r14=PID,r13 + ;; + ld4 r16=[r14] + ;; + sub r15=0,r16 + cmp.eq p6,p0=0,r16 + ;; +(p6) movl r15=0x80000000 + mov out0=CLONE_VM+CLONE_VFORK+SIGCHLD + mov out1=0 /* Standard sp value. */ + ;; + st4 [r14]=r15 + DO_CALL_VIA_BREAK (SYS_ify (clone)) + cmp.eq p6,p0=0,r8 + adds r14=PID,r13 +(p6) br.cond.dptk 1f + ;; + ld4 r15=[r14] + ;; + extr.u r16=r15,0,31 + ;; + cmp.eq p0,p6=0,r16 + ;; +(p6) sub r16=0,r15 + ;; + st4 [r14]=r16 +1: + cmp.eq p6,p0=-1,r10 +(p6) br.cond.spnt.few __syscall_error + ret +PSEUDO_END(__vfork) +libc_hidden_def (__vfork) + +weak_alias (__vfork, vfork) diff --git a/nptl/sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S b/nptl/sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S index 67a5bc6613..60d6dbdef6 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S +++ b/nptl/sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S @@ -22,6 +22,7 @@ #include #include #include +#include /* Clone the calling process, but without copying the whole address space. The calling process is suspended until the new process exits or is @@ -29,9 +30,18 @@ and the process ID of the new process to the old process. */ ENTRY (__vfork) + ear %r4,%a0 + l %r3,PID(%r4) + lcr %r1,%r3 + st %r1,PID(%r4) + /* Do vfork system call. */ svc SYS_ify (vfork) + ltr %r2,%r2 + je 1f + st %r3,PID(%r4) +1: /* Check for error. */ lhi %r4,-4095 clr %r2,%r4 diff --git a/nptl/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S b/nptl/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S new file mode 100644 index 0000000000..2dca28fb6f --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S @@ -0,0 +1,57 @@ +/* Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2004. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#define _ERRNO_H 1 +#include +#include +#include +#include + +/* Clone the calling process, but without copying the whole address space. + The calling process is suspended until the new process exits or is + replaced by a call to `execve'. Return -1 for errors, 0 to the new process, + and the process ID of the new process to the old process. */ + +ENTRY (__vfork) + ear %r4,%a0 + lhi %r1,1 + icm %r3,15,PID(%r4) + sll %r1,31 + je 1f + lcr %r1,%r3 +1: st %r1,PID(%r4) + + /* Do vfork system call. */ + svc SYS_ify (vfork) + + ltr %r2,%r2 + je 1f + st %r3,PID(%r4) +1: + /* Check for error. */ + lhi %r4,-4095 + clr %r2,%r4 + jnl SYSCALL_ERROR_LABEL + + /* Normal return. */ + br %r14 +PSEUDO_END(__vfork) + +weak_alias (__vfork, vfork) diff --git a/nptl/sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S b/nptl/sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S index e45165e37b..fcc7ee0804 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S +++ b/nptl/sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky , 2003. @@ -22,6 +22,7 @@ #include #include #include +#include /* Clone the calling process, but without copying the whole address space. The calling process is suspended until the new process exits or is @@ -29,9 +30,21 @@ and the process ID of the new process to the old process. */ ENTRY (__vfork) + + ear %r4,%a0 + sllg %r4,%r4,32 + ear %r4,%a1 + l %r3,PID(%r4) + lcr %r1,%r3 + st %r1,PID(%r4) + /* Do vfork system call. */ svc SYS_ify (vfork) + ltgr %r2,%r2 + je 1f + st %r3,PID(%r4) +1: /* Check for error. */ lghi %r4,-4095 clgr %r2,%r4 diff --git a/nptl/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S b/nptl/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S new file mode 100644 index 0000000000..c73d849f25 --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S @@ -0,0 +1,59 @@ +/* Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2004. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#define _ERRNO_H 1 +#include +#include +#include +#include + +/* Clone the calling process, but without copying the whole address space. + The calling process is suspended until the new process exits or is + replaced by a call to `execve'. Return -1 for errors, 0 to the new process, + and the process ID of the new process to the old process. */ + +ENTRY (__vfork) + + ear %r4,%a0 + sllg %r4,%r4,32 + ear %r4,%a1 + icm %r3,15,PID(%r4) + llilh %r1,32768 + je 1f + lcr %r1,%r3 +1: st %r1,PID(%r4) + + /* Do vfork system call. */ + svc SYS_ify (vfork) + + ltgr %r2,%r2 + je 1f + st %r3,PID(%r4) +1: + /* Check for error. */ + lghi %r4,-4095 + clgr %r2,%r4 + jnl SYSCALL_ERROR_LABEL + + /* Normal return. */ + br %r14 +PSEUDO_END(__vfork) + +weak_alias (__vfork, vfork) diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S b/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S deleted file mode 100644 index 006bc96bd6..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Jakub Jelinek , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include - -PSEUDO (__vfork, vfork, 0) - sub %o1, 1, %o1 - retl - and %o0, %o1, %o0 - -PSEUDO_END (__vfork) -weak_alias (__vfork, vfork) diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S new file mode 100644 index 0000000000..55229c9e66 --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S @@ -0,0 +1,42 @@ +/* Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2004. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include + + .text +ENTRY(__vfork) + ld [%g7 + PID], %o5 + sub %g0, %o5, %o4 + st %o4, [%g7 + PID] + + LOADSYSCALL(vfork) + ta 0x10 + bcs,a __syscall_error_handler + st %o5, [%g7 + PID] + SYSCALL_ERROR_HANDLER + sub %o1, 1, %o1 + andcc %o0, %o1, %o0 + bne,a 1f + st %o5, [%g7 + PID] +1: retl + nop + +PSEUDO_END (__vfork) +weak_alias (__vfork, vfork) diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S new file mode 100644 index 0000000000..6a65a881af --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S @@ -0,0 +1,45 @@ +/* Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2004. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include + + .text +ENTRY(__vfork) + ld [%g7 + PID], %o5 + cmp %o5, 0 + bne 1f + sub %g0, %o5, %o4 + sethi %hi(0x80000000), %o4 +1: st %o4, [%g7 + PID] + + LOADSYSCALL(vfork) + ta 0x10 + bcs,a __syscall_error_handler + st %o5, [%g7 + PID] + SYSCALL_ERROR_HANDLER + sub %o1, 1, %o1 + andcc %o0, %o1, %o0 + bne,a 1f + st %o5, [%g7 + PID] +1: retl + nop + +PSEUDO_END (__vfork) +weak_alias (__vfork, vfork) diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S b/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S new file mode 100644 index 0000000000..e9018b2e99 --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S @@ -0,0 +1,42 @@ +/* Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2004. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include + + .text +ENTRY(__vfork) + ld [%g7 + PID], %o5 + sub %g0, %o5, %o4 + st %o4, [%g7 + PID] + + LOADSYSCALL(vfork) + ta 0x6d + bcs,a,pn %xcc, __syscall_error_handler + st %o5, [%g7 + PID] + SYSCALL_ERROR_HANDLER + sub %o1, 1, %o1 + andcc %o0, %o1, %o0 + bne,a,pt %icc, 1f + st %o5, [%g7 + PID] +1: retl + nop + +PSEUDO_END (__vfork) +weak_alias (__vfork, vfork) diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S b/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S new file mode 100644 index 0000000000..c9ccd0f57d --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S @@ -0,0 +1,45 @@ +/* Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2004. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include + + .text +ENTRY(__vfork) + ld [%g7 + PID], %o5 + sethi %hi(0x80000000), %o3 + cmp %o5, 0 + sub %g0, %o5, %o4 + move %icc, %o3, %o4 + st %o4, [%g7 + PID] + + LOADSYSCALL(vfork) + ta 0x6d + bcs,a,pn %xcc, __syscall_error_handler + st %o5, [%g7 + PID] + SYSCALL_ERROR_HANDLER + sub %o1, 1, %o1 + andcc %o0, %o1, %o0 + bne,a,pt %icc, 1f + st %o5, [%g7 + PID] +1: retl + nop + +PSEUDO_END (__vfork) +weak_alias (__vfork, vfork) -- cgit v1.2.3