public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Ulrich Drepper <drepper@redhat.com>
Cc: libc-hacker@sources.redhat.com
Subject: Re: getpid/vfork broken
Date: Tue, 09 Mar 2004 13:01:00 -0000	[thread overview]
Message-ID: <jewu5umaxq.fsf@sykes.suse.de> (raw)
In-Reply-To: <404D76CA.4010500@redhat.com> (Ulrich Drepper's message of "Mon, 08 Mar 2004 23:48:26 -0800")

Ulrich Drepper <drepper@redhat.com> writes:

> Anyway, for the getpid handling, the other archs need to be handled,
> too.  The x86/x86-64 changes are kept small, I envision this is the
> model for the other archs, too.

Here's the same for ia64.

Andreas.

2004-03-09  Andreas Schwab  <schwab@suse.de>

	* sysdeps/ia64/tcb-offsets.sym: Add PID.
	* sysdeps/unix/sysv/linux/ia64/vfork.S: New file.

--- nptl/sysdeps/ia64/tcb-offsets.sym.~1.5.~	2003-12-11 11:35:12.000000000 +0100
+++ nptl/sysdeps/ia64/tcb-offsets.sym	2004-03-09 10:49:45.000000000 +0100
@@ -1,5 +1,6 @@
 #include <sysdep.h>
 #include <tls.h>
 
+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)
--- /dev/null	2004-02-28 23:52:18.000000000 +0100
+++ nptl/sysdeps/unix/sysv/linux/ia64/vfork.S	2004-03-09 13:19:05.000000000 +0100
@@ -0,0 +1,54 @@
+/* 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 <sysdep.h>
+#define _SIGNAL_H
+#include <bits/signum.h>
+#include <tcb-offsets.h>
+
+/* 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,1,2,0
+	adds r14=PID,r13
+	mov r15=-1
+	;; 
+	ld4 loc0=[r14]
+	st4 [r14]=r15
+	mov out0=CLONE_VM+CLONE_VFORK+SIGCHLD
+	mov out1=0		/* Standard sp value.			*/
+	;;
+	DO_CALL_VIA_BREAK (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)
+libc_hidden_def (__vfork)
+
+weak_alias (__vfork, vfork)

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  reply	other threads:[~2004-03-09 13:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-07 23:18 Andreas Schwab
2004-03-07 23:30 ` Ulrich Drepper
2004-03-08  2:22   ` Roland McGrath
2004-03-08  2:28     ` Ulrich Drepper
2004-03-08  2:37       ` Roland McGrath
2004-03-08 13:10         ` Jakub Jelinek
2004-03-09  1:28           ` Roland McGrath
2004-03-09  2:04             ` Ulrich Drepper
2004-03-09  3:50               ` Richard Henderson
2004-03-09  7:48           ` Ulrich Drepper
2004-03-09 13:01             ` Andreas Schwab [this message]
2004-03-09 13:59               ` [PATCH] getpid/vfork/raise fix Jakub Jelinek
2004-03-09 16:44                 ` Andreas Schwab
2004-03-09 19:38                   ` Jakub Jelinek
2004-03-10  5:53                 ` Ulrich Drepper
2004-03-10 10:37                 ` Andreas Schwab
2004-03-10 12:24                   ` Jakub Jelinek
2004-03-10 14:33                     ` Andreas Schwab
2004-03-10 15:01                       ` Jakub Jelinek
2004-03-10 15:06                         ` Andreas Schwab
2004-03-10 16:56                       ` David Mosberger
2004-03-10 17:02                         ` Jakub Jelinek
2004-03-10 17:45                           ` David Mosberger
2004-03-10 18:19                             ` Jakub Jelinek
2004-03-10 19:24                               ` David Mosberger
2004-03-10 18:44                   ` Ulrich Drepper
2004-03-10 19:18                     ` [PATCH] IA-64 pt-vfork fix Jakub Jelinek
2004-03-10 23:10                       ` Ulrich Drepper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jewu5umaxq.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=drepper@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).