From patchwork Thu Apr 17 04:49:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 589 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx23.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 25C08360072 for ; Wed, 16 Apr 2014 21:53:12 -0700 (PDT) Received: by homiemail-mx23.g.dreamhost.com (Postfix, from userid 14307373) id BF1EE62920184; Wed, 16 Apr 2014 21:53:11 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx23.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx23.g.dreamhost.com (Postfix) with ESMTPS id 6F161628C0418 for ; Wed, 16 Apr 2014 21:53:11 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=gsvBz9ltts3m/smUUocH5qCStCPLge9 sIZ3eqilEzgpj9n7YM5CnyoLEB1KCbaxwFONV6mM0qhJ1o+rBSJzHMhAdIqtw898 QjuHoaiLFMxCvbNsMESVO5aWdyrtTqg88aKBemIgf50TrhNBlQEHFvhKaEUP6gye LqJjPjbBZiQU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=W3xXl2CL+vP6A0VLa16iZOV32J0=; b=wR28u yQDAeAdK+2Pkbh/NPtCSIEWCqBXeYrglM1+dFyw7S1gu0das3rYVrzlVWdyG4lju CuoDRJnGiHV3hMH8C/M7dQ0zV+OKledtqJKRUp6ilIzSJk7M2Pnd+KmHPSwfCBz/ Dk8xTEuCfdAhXM6S4WpjLm81Je6qaUevz92uPo= Received: (qmail 18735 invoked by alias); 17 Apr 2014 04:52:48 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 18705 invoked by uid 89); 17 Apr 2014 04:52:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_50, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pd0-f173.google.com X-Received: by 10.66.218.226 with SMTP id pj2mr3622799pac.134.1397710363492; Wed, 16 Apr 2014 21:52:43 -0700 (PDT) From: Richard Henderson To: libc-alpha@sourceware.org Subject: [PATCH 4/4] alpha: Remove alpha-linux pthread_once.c Date: Wed, 16 Apr 2014 21:49:39 -0700 Message-Id: <1397710179-28556-5-git-send-email-rth@twiddle.net> In-Reply-To: <1397710179-28556-1-git-send-email-rth@twiddle.net> References: <1397710179-28556-1-git-send-email-rth@twiddle.net> X-DH-Original-To: glibc@patchwork.siddhesh.in --- ChangeLog | 2 + sysdeps/unix/sysv/linux/alpha/nptl/pthread_once.c | 95 ----------------------- 2 files changed, 2 insertions(+), 95 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/alpha/nptl/pthread_once.c diff --git a/ChangeLog b/ChangeLog index a54ec9a..73e8d37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2014-04-16 Richard Henderson + * sysdeps/unix/sysv/linux/alpha/nptl/pthread_once.c: Remove. + * sysdeps/alpha/Makefile [debug] (CFLAGS-backtrace.c): Enable unwind tables. diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/pthread_once.c b/sysdeps/unix/sysv/linux/alpha/nptl/pthread_once.c deleted file mode 100644 index ab4d547..0000000 --- a/sysdeps/unix/sysv/linux/alpha/nptl/pthread_once.c +++ /dev/null @@ -1,95 +0,0 @@ -/* Copyright (C) 2003-2014 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, see - . */ - -#include "pthreadP.h" -#include - - -unsigned long int __fork_generation attribute_hidden; - -static void -clear_once_control (void *arg) -{ - pthread_once_t *once_control = (pthread_once_t *) arg; - - *once_control = 0; - lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE); -} - -int -__pthread_once (pthread_once_t *once_control, void (*init_routine) (void)) -{ - for (;;) - { - int oldval; - int newval; - int tmp; - - /* Pseudo code: - newval = __fork_generation | 1; - oldval = *once_control; - if ((oldval & 2) == 0) - *once_control = newval; - Do this atomically. - */ - newval = __fork_generation | 1; - __asm __volatile ( - "1: ldl_l %0, %2\n" - " and %0, 2, %1\n" - " bne %1, 2f\n" - " mov %3, %1\n" - " stl_c %1, %2\n" - " beq %1, 1b\n" - "2: mb" - : "=&r" (oldval), "=&r" (tmp), "=m" (*once_control) - : "r" (newval), "m" (*once_control)); - - /* Check if the initializer has already been done. */ - if ((oldval & 2) != 0) - return 0; - - /* Check if another thread already runs the initializer. */ - if ((oldval & 1) == 0) - break; - - /* Check whether the initializer execution was interrupted by a fork. */ - if (oldval != newval) - break; - - /* Same generation, some other thread was faster. Wait. */ - lll_futex_wait (once_control, oldval, LLL_PRIVATE); - } - - /* This thread is the first here. Do the initialization. - Register a cleanup handler so that in case the thread gets - interrupted the initialization can be restarted. */ - pthread_cleanup_push (clear_once_control, once_control); - - init_routine (); - - pthread_cleanup_pop (0); - - /* Add one to *once_control to take the bottom 2 bits from 01 to 10. */ - atomic_increment (once_control); - - /* Wake up all other threads. */ - lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE); - - return 0; -} -weak_alias (__pthread_once, pthread_once) -hidden_def (__pthread_once)