From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5739 invoked by alias); 10 Mar 2004 10:37:47 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 5716 invoked from network); 10 Mar 2004 10:37:45 -0000 Received: from unknown (HELO Cantor.suse.de) (195.135.220.2) by sources.redhat.com with SMTP; 10 Mar 2004 10:37:45 -0000 Received: from hermes.suse.de (Hermes.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 1C5822C96AD; Wed, 10 Mar 2004 11:37:45 +0100 (CET) To: Jakub Jelinek Cc: Ulrich Drepper , Glibc hackers Subject: Re: [PATCH] getpid/vfork/raise fix References: <404BDA36.6000202@redhat.com> <200403080237.i282bXG6004322@magilla.sf.frob.com> <20040308110105.GN3822@sunsite.ms.mff.cuni.cz> <404D76CA.4010500@redhat.com> <20040309115038.GO3822@sunsite.ms.mff.cuni.cz> From: Andreas Schwab X-Yow: TATTOOED MIDGETS are using ALFREDO in their SALAMI FACTORY! Date: Wed, 10 Mar 2004 10:37:00 -0000 In-Reply-To: <20040309115038.GO3822@sunsite.ms.mff.cuni.cz> (Jakub Jelinek's message of "Tue, 9 Mar 2004 12:50:38 +0100") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2004-03/txt/msg00041.txt.bz2 Here are the corresponding changes for ia64. Andreas. 2004-03-10 Andreas Schwab * sysdeps/ia64/tcb-offsets.sym: Add PID. * sysdeps/unix/sysv/linux/ia64/vfork.S: New file. * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache. --- 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 #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) --- nptl/sysdeps/unix/sysv/linux/ia64/pt-vfork.S.~1.2.~ 2003-12-11 11:35:12.000000000 +0100 +++ nptl/sysdeps/unix/sysv/linux/ia64/pt-vfork.S 2004-03-10 11:28:34.057587179 +0100 @@ -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) --- /dev/null 2004-02-28 23:52:18.000000000 +0100 +++ nptl/sysdeps/unix/sysv/linux/ia64/vfork.S 2004-03-10 09:36:47.000000000 +0100 @@ -0,0 +1,58 @@ +/* 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,1,2,0 + adds r14=PID,r13 + ;; + ld4 loc0=[r14] + ;; + sub r15=0,loc0 + cmp.eq p0,p6=0,loc0 + ;; +(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 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."