From patchwork Tue Dec 10 18:32:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 181148 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp6242087ile; Tue, 10 Dec 2019 10:33:16 -0800 (PST) X-Google-Smtp-Source: APXvYqwLkHqnEWlqqMBkKIS0d+GSQpqe9B06ZSe2o122nYOdduFuBsZXxkjaPeZAWxHuVQuqXipM X-Received: by 2002:a05:6808:681:: with SMTP id k1mr181994oig.117.1576002796691; Tue, 10 Dec 2019 10:33:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576002796; cv=none; d=google.com; s=arc-20160816; b=eVPZr3F3OmaNfYMfDbxTIEef9WRXZarCH/ZuXcTvFRIUXpYSZQ4tzSWuSxRjIYhtYI dWmeCM1TJ+uvjok/TYHVesQRECzf3lCjH5jzaak1661PRYD6XnQVy9TWE7cGXemB8AGp c/1ZaDL8WEVwBHTvgMni7XAvizDHUcO0nFlPY2b4CDlg7as517WmPcUc/j811jM5jKTi vjUdr5cmbyiYspkcTSXxprz04b52KaZ3XNwHfYczgjWy0IHjpWTAiIMnxo0Mv0/BeWf7 2/vvabHCL7WEUeLwkOdX9qVDXvotPKfHCKu9KmFfQqJLuTeI+AmIVvNm36CZfxymyI33 rpZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=plT90yHYMq9KJhSKgfBtVdIcr2ScTS8n0bGEHINWPbA=; b=h196iClYDGwx6ANii2HN9pS8xDZOePI71pdJCS+2HAdl1ZbN81PJsmFVlqdsbI9cF5 Oe/cjJrNL6qlx5mBJQaI/ltxZ9ghfMgPbVMCnpLoeQAUn63P+NqCP9cgsemjR8EizR+X e2Udb5VYWRUZOfn1TXuVXgXu8jMRJk/EiJkxJDTlrdcTrzQU1AS+yv3lvqEY3JGbR7y1 1pGX5dD3y3hBpaSaG68A1lEkbDrmXdrv/VRGBoITo8uiVWmV8Nq+zEtyiayIBEROrls7 PbI4XkxG62QJTl1cbt1hCfSQzFtv29zFVKMiL7axjUKoN7wGJVYAczmVBwCr7QHYuPvS eWIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=lrTdJhfA; dkim=pass header.i=@linaro.org header.s=google header.b=HWEib8OS; spf=pass (google.com: domain of libc-alpha-return-107899-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-107899-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id i198si2242487oib.111.2019.12.10.10.33.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Dec 2019 10:33:16 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-107899-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=lrTdJhfA; dkim=pass header.i=@linaro.org header.s=google header.b=HWEib8OS; spf=pass (google.com: domain of libc-alpha-return-107899-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-107899-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=ajUO4cVYBroaPoKPpk4MCFCKuH/6e8t 5ICFmbH1R9+mJUaPkW+QOnrPAtICkJ8/WSqg2E4hgvA3fpyd4xgEOaqEanUck1LV fhRFOxE0yFx+p66w2vVRZftb+b3/FhXJ8mmSxb53ZQpYm+eMSRh58T/gm7SBwuu3 NJdWRxQ2Cu9Y= 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=Vi8sGO3gUYsVqWi9ZRsGn10mTIQ=; b=lrTdJ hfAw2Fern+TBR9DK8/7lOdWaRtSiLdd49rMOC+b7oxNtcje8bLs+PE5ynaDqX98n 7jnwFXJbhRayRS54m8zbbl5Z2u8aw6ZXefuaZ/02ZzjKGR/dhdji0G616+eaKrcd bGzsDR2wnt+nQ6j6aWGTITWyAU1BtegR3hqPlw= Received: (qmail 39801 invoked by alias); 10 Dec 2019 18:32:38 -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 39739 invoked by uid 89); 10 Dec 2019 18:32:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=April, april, 1999, H*RU:209.85.222.67 X-HELO: mail-ua1-f67.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=plT90yHYMq9KJhSKgfBtVdIcr2ScTS8n0bGEHINWPbA=; b=HWEib8OSsaWIZToRXYH9UdhZWbQPFW8xPq2j8Cf56PSUTNLAi110DVrWpBZphe2oMo sOiJWuDl6s8My9E7bx5bDMCwtF5QZJCWXiRY2JPwfxcwTtWEcA/t6v+8OywMBEvAXw3f Ht/gXmlG3lVQ8mLdW2idQlPMIJIUzqhQuaIJmym7kHrLjWjSpDB52X+7Rg9jW5NmnPUf vmdZSdUAE4PWNY4gbOX0VAhT94tbTE38UN7jYJuYCZFzu/N51OaNzXR09/S+wE6pvOVG 2phxxvj6KzoYPu4uhwwy4zJ2VArpxuj5X+smI+ALVwpjnmap8R+0tIDCKlykd/XdnJac gmNA== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 4/7] linux: Consolidate sigprocmask Date: Tue, 10 Dec 2019 15:32:18 -0300 Message-Id: <20191210183221.26912-4-adhemerval.zanella@linaro.org> In-Reply-To: <20191210183221.26912-1-adhemerval.zanella@linaro.org> References: <20191210183221.26912-1-adhemerval.zanella@linaro.org> All architectures now uses the Linux generic implementation which uses __NR_rt_sigprocmask. Checked on x86_64-linux-gnu, sparc64-linux-gnu, ia64-linux-gnu, s390x-linux-gnu, and alpha-linux-gnu. --- sysdeps/unix/sysv/linux/alpha/sigprocmask.c | 58 ------------------- sysdeps/unix/sysv/linux/ia64/sigprocmask.c | 40 ------------- .../sysv/linux/s390/s390-64/sigprocmask.c | 38 ------------ sysdeps/unix/sysv/linux/sigprocmask.c | 14 +---- .../sysv/linux/sparc/sparc64/sigprocmask.c | 34 ----------- sysdeps/unix/sysv/linux/x86_64/sigprocmask.c | 39 ------------- 6 files changed, 3 insertions(+), 220 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/alpha/sigprocmask.c delete mode 100644 sysdeps/unix/sysv/linux/ia64/sigprocmask.c delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c delete mode 100644 sysdeps/unix/sysv/linux/x86_64/sigprocmask.c -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/alpha/sigprocmask.c b/sysdeps/unix/sysv/linux/alpha/sigprocmask.c deleted file mode 100644 index 0e807179bf..0000000000 --- a/sysdeps/unix/sysv/linux/alpha/sigprocmask.c +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (C) 1993-2019 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Mosberger (davidm@azstarnet.com). - - 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 -#include -#include - -/* When there is kernel support for more than 64 signals, we'll have to - switch to a new system call convention here. */ - -int -__sigprocmask (int how, const sigset_t *set, sigset_t *oset) -{ - unsigned long int setval; - long result; - - if (set) - setval = set->__val[0]; - else - { - setval = 0; - how = SIG_BLOCK; /* ensure blocked mask doesn't get changed */ - } - - result = INLINE_SYSCALL (osf_sigprocmask, 2, how, setval); - if (result == -1) - /* If there are ever more than 63 signals, we need to recode this - in assembler since we wouldn't be able to distinguish a mask of - all 1s from -1, but for now, we're doing just fine... */ - return result; - - if (oset) - { - oset->__val[0] = result; - result = _SIGSET_NWORDS; - while (--result > 0) - oset->__val[result] = 0; - } - return 0; -} - -libc_hidden_def (__sigprocmask) -weak_alias (__sigprocmask, sigprocmask); diff --git a/sysdeps/unix/sysv/linux/ia64/sigprocmask.c b/sysdeps/unix/sysv/linux/ia64/sigprocmask.c deleted file mode 100644 index 81c2d3cd8e..0000000000 --- a/sysdeps/unix/sysv/linux/ia64/sigprocmask.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 1997-2019 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Linux/IA64 specific sigprocmask - Written by Jes Sorensen, , April 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, see - . */ - -/* Linux/ia64 only has rt signals, thus we do not even want to try falling - back to the old style signals as the default Linux handler does. */ - -#include -#include -#include - -#include -#include - -/* Get and/or change the set of blocked signals. */ -int -__sigprocmask (int how, const sigset_t *set, sigset_t *oset) -{ - - /* XXX The size argument hopefully will have to be changed to the - real size of the user-level sigset_t. */ - return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8); -} -libc_hidden_def (__sigprocmask) -weak_alias (__sigprocmask, sigprocmask) diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c b/sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c deleted file mode 100644 index f0eb099748..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2001-2019 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 - . */ - -/* 64 bit Linux for S/390 only has rt signals, thus we do not even want to try - falling back to the old style signals as the default Linux handler does. */ - -#include -#include -#include - -#include -#include - -/* Get and/or change the set of blocked signals. */ -int -__sigprocmask (int how, const sigset_t *set, sigset_t *oset) -{ - - /* XXX The size argument hopefully will have to be changed to the - real size of the user-level sigset_t. */ - return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8); -} -libc_hidden_def (__sigprocmask) -weak_alias (__sigprocmask, sigprocmask) diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c index 01521c8107..73b0d0c19a 100644 --- a/sysdeps/unix/sysv/linux/sigprocmask.c +++ b/sysdeps/unix/sysv/linux/sigprocmask.c @@ -15,17 +15,9 @@ License along with the GNU C Library; if not, see . */ -#include #include -#include /* Needed for string function builtin redirection. */ -#include - -#include -#include - #include /* SIGCANCEL, SIGSETXID */ - /* Get and/or change the set of blocked signals. */ int __sigprocmask (int how, const sigset_t *set, sigset_t *oset) @@ -35,8 +27,8 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset) /* The only thing we have to make sure here is that SIGCANCEL and SIGSETXID are not blocked. */ if (set != NULL - && (__builtin_expect (__sigismember (set, SIGCANCEL), 0) - || __builtin_expect (__sigismember (set, SIGSETXID), 0))) + && __glibc_unlikely (__sigismember (set, SIGCANCEL) + || __glibc_unlikely (__sigismember (set, SIGSETXID)))) { local_newmask = *set; __sigdelset (&local_newmask, SIGCANCEL); @@ -44,7 +36,7 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset) set = &local_newmask; } - return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8); + return INLINE_SYSCALL_CALL (rt_sigprocmask, how, set, oset, _NSIG / 8); } libc_hidden_def (__sigprocmask) weak_alias (__sigprocmask, sigprocmask) diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c b/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c deleted file mode 100644 index 5823826ab2..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright (C) 1997-2019 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 -#include -#include - -#include -#include - -/* Get and/or change the set of blocked signals. */ -int -__sigprocmask (int how, const sigset_t *set, sigset_t *oset) -{ - /* XXX The size argument hopefully will have to be changed to the - real size of the user-level sigset_t. */ - return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8); -} -libc_hidden_def (__sigprocmask) -weak_alias (__sigprocmask, sigprocmask) diff --git a/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c b/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c deleted file mode 100644 index c2e721d7b9..0000000000 --- a/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 1997-2019 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Written by Jes Sorensen, , April 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, see - . */ - -/* Linux/x86_64 only has rt signals, thus we do not even want to try falling - back to the old style signals as the default Linux handler does. */ - -#include -#include -#include - -#include -#include - -/* Get and/or change the set of blocked signals. */ -int -__sigprocmask (int how, const sigset_t *set, sigset_t *oset) -{ - - /* XXX The size argument hopefully will have to be changed to the - real size of the user-level sigset_t. */ - return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8); -} -libc_hidden_def (__sigprocmask) -weak_alias (__sigprocmask, sigprocmask)