From patchwork Wed Jul 6 15:10:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 1653023 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=BVKP+xp2; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LdNKv3kS6z9ryY for ; Thu, 7 Jul 2022 01:11:31 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C41293858436 for ; Wed, 6 Jul 2022 15:11:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C41293858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1657120286; bh=/OupyG+sop4wcE23EEiFaUH0H4kdXtM99v/U7mVgcyA=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=BVKP+xp2WSVRd1ZvnAamP81EjMHsQ9PsLqKjR/A4fR7Dllw2jI9vXhqHNlu1e0TFU C9RXyJKU3JINDh1HwavMT72MWQLV6CWSYmyJQ52NT9ZhkiFmLyTWmVEd2D/L4ONNRU 1kPB10zTnjD+csSvOxGZVFujCGUJ2iXhRTusHrW0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2063.outbound.protection.outlook.com [40.107.20.63]) by sourceware.org (Postfix) with ESMTPS id CB5C83858C20 for ; Wed, 6 Jul 2022 15:11:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CB5C83858C20 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=ICPJY6a+AGJ+W3HNu3wFIYCYF27gfC25yZuBdJ5/RbBUBiIMIuoOBPCGwaaSg+rudZKSRIjzexYGWiHcHA9HfSedJ53bAtQLjOI4LSgqU/yaX/0UEv5blXhfu8D8RZicvtRgj89DIBLR8Rm/QYAkBXV4bnj7+FIwyeVf+m5oeNqNFU2peWkMZc/ZVcok8pdhdUsjxCjMC7YfjLFGS+h/V9dnxZBaKjgEsC/jcj5UiVl7KIvMs3REeOWaB4L6MO07JSAhODInV83AWRYhlY4yzn+TCtOLdlHOO74hB4aXhSDIAWIZ1W43uQKTZadbqXz26GGzrWbrttv0A3j4jxiRYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/OupyG+sop4wcE23EEiFaUH0H4kdXtM99v/U7mVgcyA=; b=NITkptXsmvGWCG+TlvgxATfQRF3kXtGdaUBBg/zTBbrwJsielvhFEUR+prqPExciY3mu8VOtBRpecDXW864k4cGZqayCQElS6/ceX7EsFIWsrMLOkFj2p9RPpmTEzfLHhiD6IOARbH6zBRHp3Bj7hMrSS3BjfOmXscPEwGPwP3ObcpQ8947JZ8WHwzCwNpLRldeSP00Sq74nhVcLtK2pcSfawJnGk6GUVr1fSVi98bfPs6iiD/DIZlIqv2aHXRuYX/DFmyZqg0wF//f+OVOUXcb7AypobCH/kvaoIWBcvhRUaWcFat9h+abXBRXdirYlZCUYAVQfI0H9doELBji7tw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) Received: from AM7PR02CA0020.eurprd02.prod.outlook.com (2603:10a6:20b:100::30) by VI1PR0801MB2078.eurprd08.prod.outlook.com (2603:10a6:800:83::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15; Wed, 6 Jul 2022 15:11:05 +0000 Received: from VE1EUR03FT036.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:100:cafe::57) by AM7PR02CA0020.outlook.office365.com (2603:10a6:20b:100::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.21 via Frontend Transport; Wed, 6 Jul 2022 15:11:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT036.mail.protection.outlook.com (10.152.19.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Wed, 6 Jul 2022 15:11:04 +0000 Received: ("Tessian outbound e5f49c5d38f9:v122"); Wed, 06 Jul 2022 15:11:04 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 8fc81aef0d31847b X-CR-MTA-TID: 64aa7808 Received: from 8b0860295aa8.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2EF6E49C-C214-4687-AE1B-05EB9C6127CB.1; Wed, 06 Jul 2022 15:10:57 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8b0860295aa8.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 06 Jul 2022 15:10:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fPjDc6zvIOSBf9eRnqTeCTH2pL/BZDwWZkrfazuXc/tiNer099pSjEh70L+HWhnhYobJFWQ3NsalWoHAvXaYecNIFl45cKAs9AK0J+808EbDrBdCif6fOeNggGMa28Jpf3iMAYcBSBV8iSFKoI73zsvz68/cAeM3OhxcC0SFr2AlDabGo6ZaJkGO6ZWv84FDmYs7Tj1f9wQzQ/2xig00tzxuLnrm9A7PVnHZjlCnvewp1XhGQF8bwZvY/HJTCucaj+MgBES2SAs05Yg8liLFUuHdDru3l6qwkUIyoJitmnKiQai9kZV61qb+LJ5IEo4J50tw2yCSqUobu3xETmLTvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/OupyG+sop4wcE23EEiFaUH0H4kdXtM99v/U7mVgcyA=; b=BmgHZ+mqxD9A8Xo2UVGidY91/le69bfeQUcHIfrn8wyrHvDQQyCTAww31albCPCin+cgIhQIk/dXoDiE6glKWZjBTfvJ+li98ChRdzWPJ5w4Evydg9Hibkzo/oGAf7QomOdhNSt6SQdUoRvuGW5r6Z+ST7fRiNE2MfMDV8mq4vmzw7puF7I3cCkeunElm9K0c2hNQNlpqmGe7p5iFlf2UEXMIS/D9HsMqydOwwjvdKU8WHrPTlTJk/G4LlMn3r7ae0gs63eu+vTGqLjA+VN3naMo8yg19o3rqYTW09Yd2ix2XRB39BhK3GAJGYxZms/UT8W6dmQwx90bQozvGVzoUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Received: from AM5PR0801MB1668.eurprd08.prod.outlook.com (2603:10a6:203:3c::14) by AM4PR0802MB2178.eurprd08.prod.outlook.com (2603:10a6:200:5a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15; Wed, 6 Jul 2022 15:10:45 +0000 Received: from AM5PR0801MB1668.eurprd08.prod.outlook.com ([fe80::845f:5b9c:410a:f581]) by AM5PR0801MB1668.eurprd08.prod.outlook.com ([fe80::845f:5b9c:410a:f581%5]) with mapi id 15.20.5417.015; Wed, 6 Jul 2022 15:10:45 +0000 To: 'GNU C Library' Subject: [PATCH 1/7] Use atomic_exchange_release/acquire Thread-Topic: [PATCH 1/7] Use atomic_exchange_release/acquire Thread-Index: AQHYkUpT1hmC/C1AMU2s/I50D12OeA== Date: Wed, 6 Jul 2022 15:10:45 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-MS-Office365-Filtering-Correlation-Id: 13a1a17a-4fee-451d-cf7b-08da5f61bee2 x-ms-traffictypediagnostic: AM4PR0802MB2178:EE_|VE1EUR03FT036:EE_|VI1PR0801MB2078:EE_ x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: lQMTyL6GkrJ9hONhFliabFsJxKfdqT4kcj46QrkKpGYa2BfRyTF6PJhSIEwIxd0v6L2uMG5I+M+kvVO5sG/Hs88H5nL4FaZ1WZKEi15wt1GLHppzyLV8jzejg61tqJuBx8Gfg60qMOMbJBnYiLT0pggbsATE1XJzX0D5iXhwC+85c4EG7XqaIYZNgvhUCZIIiYTWz8PJXlRv1lSW0q8VcR2T5zJbqZklcTQM4RqleyakuhRX0hjKO/SAtc+xW3ZkkODkvxrF0pETbs2JOtt2BUR1drHpg90Ep75t8aFiNgCRTFL3gW7PXGsg3rfL4g0S5o1IkoicBtmrjw/Hj6wB6S7G84HD3A2chV7twzwlwfXGUl6NDCQVlU4cngC08kzx1exBKEdYfUQ5zUkMSjrWhgj68pQGIuoPEYM9UG50PAJkrvSeKyAskz8izNBfjjHMU4FR+nNMYs6JmiC0HOIor5nG4Zo63kmhlWbIYdCx4tFeUBh8VnjfxRMjeXPPqYk/2w5vSznNkLT5MVdaTlI1rWC4mgG3xEgKskV9ESSBDvh0NrRx5xPgbMZhxJ61FVjBjODrWSEm4DhDrzI8SBfDwRRN2MFinogyDAw6ep5qHcAnfmR8CPW9cMeSRbotNJQKJHGt/EHd04jXyi1cULA9UzSKEf32zhTshT1bbVp7DTOgtPadeJy01Uxe6K7gsgrjyyA9agFrDfG0cL7o+l+vphM8P5I9Y96Ag3ONu3qVWnZbpCqVAyiNZrO3PdeMQA+SLiHS7bHXAO3JxyrAGEg1pwnf9YGBZ+e1UuC3x8hrLR5NG8qtIkVQy5QTn/lWteJO X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM5PR0801MB1668.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(376002)(136003)(346002)(396003)(366004)(39860400002)(83380400001)(38070700005)(52536014)(9686003)(122000001)(186003)(6916009)(316002)(8936002)(5660300002)(2906002)(26005)(33656002)(41300700001)(478600001)(30864003)(91956017)(66946007)(66556008)(55016003)(76116006)(8676002)(6506007)(86362001)(7696005)(38100700002)(66476007)(71200400001)(64756008)(66446008)(579004)(559001); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0802MB2178 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT036.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 8f308762-8e00-4f27-d218-08da5f61b389 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FsrweShTveSx+ys8KC4Ym2OGe8My7hvpmmUerXsdFqWRlvls7MxLxLJsM7q8crgFHFK5YRhUJAnC4O+oDgTNRgvcyP34m4GzCQldiFPAyJDIQSQAIqDNRA0JelBunJQKpsCcwlGmNfAuxfytD1CIFvbkoZrSTMb3hNcX7ahmBmttVQR5ZdGQKByTMovZ1/ZahCXM5YEf2pTyWKR3URMBH+RGUBiRJbZLv6gR7Wn+K9zLdkFAWd8mlrZzI0qaqOPOAoF/wspOzhwqRzGsIXwh+rQFaTXDqWlSHw4PXd9EHlC3DaAvo7Mma1dIuyw24Mf+kH94sTp5n2FqTHtuljeZRJTSrBTml/wgXyLCrG2opgBdhx0bWutTTbLXRFzeeeiI3zsQ7A+9BN0cNW7UlYZeuWv8i73io+fTRt6DBey+mRrfnfGt8eSojf+rWouBqVjcjOV4dq5r2Pkxm/SN2hI4aq1TEL4LaZ359jDmK+xlmd8WgeuHxOZ6xZCnHf84HrGMuwPz3O4IpC8HsCBdUhGkoGNw0pXeuLZ+StLpiKcmd+koTSABwP/cG7YvYkKC7NEd1d4J0bW76O4k2BpeYQSfhjmh9x/D03esQbPQQV8vI0RdmzHfvc84LRF++F21OxlzYIdgbTlgVQ1RZ45K29ByFWIKdpWuhd92lBDZPcCCLDXYxWufaIdh1ttFYNET+nIh5PjwJ0tV43lwBmNRy8tdUWbNako9KyIwT1TtyIQuGWMsN2qHvNcyOen5WPOMq0XixJQPcEcFyDguvogY3KJbbYdiEsSEV7iBbEOH2WdMOWcsX+0cKgq1QBTuFhE/Uwdh X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230016)(4636009)(376002)(136003)(346002)(396003)(39860400002)(36840700001)(46966006)(40470700004)(83380400001)(82310400005)(52536014)(9686003)(40460700003)(186003)(6916009)(316002)(47076005)(336012)(8936002)(5660300002)(82740400003)(81166007)(356005)(2906002)(26005)(33656002)(36860700001)(41300700001)(478600001)(30864003)(55016003)(70586007)(70206006)(40480700001)(8676002)(6506007)(86362001)(7696005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2022 15:11:04.3885 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 13a1a17a-4fee-451d-cf7b-08da5f61bee2 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT036.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB2078 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Wilco Dijkstra via Libc-alpha From: Wilco Dijkstra Reply-To: Wilco Dijkstra Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" Rename atomic_exchange_rel/acq to use the standard atomic_exchange_release/acquire builtins. diff --git a/assert/assert.c b/assert/assert.c index 133a183bc337075e06447e4c8e5cfba180aaf7bf..6fe29c49ca577e12ab69172df129dcdce1ed6baf 100644 --- a/assert/assert.c +++ b/assert/assert.c @@ -74,7 +74,7 @@ __assert_fail_base (const char *fmt, const char *assertion, const char *file, /* We have to free the old buffer since the application might catch the SIGABRT signal. */ - struct abort_msg_s *old = atomic_exchange_acq (&__abort_msg, buf); + struct abort_msg_s *old = atomic_exchange_acquire (&__abort_msg, buf); if (old != NULL) __munmap (old, old->size); diff --git a/hurd/hurdlock.c b/hurd/hurdlock.c index 4f3bd3e54c6b296cfdd64b549d3f2e4669decbe2..ca407bdb1e8dea8e3979a2e8eb83acad30724ce2 100644 --- a/hurd/hurdlock.c +++ b/hurd/hurdlock.c @@ -89,7 +89,7 @@ __lll_abstimed_lock (void *ptr, while (1) { - if (atomic_exchange_acq ((int *)ptr, 2) == 0) + if (atomic_exchange_acquire ((int *)ptr, 2) == 0) return 0; else if (! valid_nanoseconds (tsp->tv_nsec)) return EINVAL; diff --git a/mach/lowlevellock.h b/mach/lowlevellock.h index a4f6af4c29d80268697477fb107d99590d3fe6d3..d0adbd42e0b4ed29984d5ce86946d3d0f5fc3dc9 100644 --- a/mach/lowlevellock.h +++ b/mach/lowlevellock.h @@ -78,7 +78,7 @@ extern kern_return_t __gsync_wait_intr || atomic_compare_and_exchange_bool_acq (__iptr, 1, 0) != 0) \ while (1) \ { \ - if (atomic_exchange_acq (__iptr, 2) == 0) \ + if (atomic_exchange_acquire (__iptr, 2) == 0) \ break; \ __lll_wait (__iptr, 2, __flags); \ } \ @@ -102,7 +102,7 @@ extern kern_return_t __gsync_wait_intr #define __lll_unlock(ptr, flags) \ ({ \ int *__iptr = (int *)(ptr); \ - if (atomic_exchange_rel (__iptr, 0) == 2) \ + if (atomic_exchange_release (__iptr, 0) == 2) \ __lll_wake (__iptr, (flags)); \ (void)0; \ }) diff --git a/malloc/malloc.c b/malloc/malloc.c index c15df0dc3ae3207a24831d2291f67b532b8caefd..1b2a19c38ac4fd0af0c0b4a953ac6580101916ca 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -4743,7 +4743,7 @@ static void malloc_consolidate(mstate av) maxfb = &fastbin (av, NFASTBINS - 1); fb = &fastbin (av, 0); do { - p = atomic_exchange_acq (fb, NULL); + p = atomic_exchange_acquire (fb, NULL); if (p != 0) { do { { diff --git a/manual/llio.texi b/manual/llio.texi index e55b02d8bd839827a352c751f11ad18114c32ed3..92bfd93e067ce2a782369084ed7dae099300f418 100644 --- a/manual/llio.texi +++ b/manual/llio.texi @@ -2538,7 +2538,7 @@ aiocb64}, since the LFS transparently replaces the old interface. @c munmap ok @c THREAD_COPY_STACK_GUARD ok @c THREAD_COPY_POINTER_GUARD ok -@c atomic_exchange_acq ok +@c atomic_exchange_acquire ok @c lll_futex_wake ok @c deallocate_stack @asulock @ascuheap @aculock @acsmem @c lll_lock (state_cache_lock) @asulock @aculock @@ -2570,7 +2570,7 @@ aiocb64}, since the LFS transparently replaces the old interface. @c atomic_increment ok @c clone ok @c atomic_decrement ok -@c atomic_exchange_acq ok +@c atomic_exchange_acquire ok @c lll_futex_wake ok @c deallocate_stack dup @c sched_setaffinity ok @@ -2590,7 +2590,7 @@ aiocb64}, since the LFS transparently replaces the old interface. @c start_thread ok @c HP_TIMING_NOW ok @c ctype_init @mtslocale -@c atomic_exchange_acq ok +@c atomic_exchange_acquire ok @c lll_futex_wake ok @c sigemptyset ok @c sigaddset ok diff --git a/manual/memory.texi b/manual/memory.texi index 5cb1dbd281006148f23cfa38c5703fb79089ba78..abc867eaebff732b2d7cc086d9f5e3430d425295 100644 --- a/manual/memory.texi +++ b/manual/memory.texi @@ -451,7 +451,7 @@ this function is in @file{stdlib.h}. @c clear_fastchunks ok @c unsorted_chunks dup ok @c fastbin dup ok -@c atomic_exchange_acq ok +@c atomic_exchange_acquire ok @c check_inuse_chunk dup ok/disabled @c chunk_at_offset dup ok @c chunksize dup ok diff --git a/misc/tst-atomic.c b/misc/tst-atomic.c index 4f9d2c1a46b363d346dbc2fa0962ae196844a43a..13acf0da8f1ab41774175401a68ce28a0eb7ed30 100644 --- a/misc/tst-atomic.c +++ b/misc/tst-atomic.c @@ -96,14 +96,6 @@ do_test (void) ret = 1; } - mem = 64; - if (atomic_exchange_acq (&mem, 31) != 64 - || mem != 31) - { - puts ("atomic_exchange_acq test failed"); - ret = 1; - } - mem = 2; if (atomic_exchange_and_add (&mem, 11) != 2 || mem != 13) diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c index 308db65cd4c148f8a119ed9025af194946aa2c80..870a8fcb34eb43b58c2260fee6a4624f0fbbd469 100644 --- a/nptl/pthread_create.c +++ b/nptl/pthread_create.c @@ -415,7 +415,7 @@ start_thread (void *arg) unwind_buf.priv.data.cleanup = NULL; /* Allow setxid from now onwards. */ - if (__glibc_unlikely (atomic_exchange_acq (&pd->setxid_futex, 0) == -2)) + if (__glibc_unlikely (atomic_exchange_acquire (&pd->setxid_futex, 0) == -2)) futex_wake (&pd->setxid_futex, 1, FUTEX_PRIVATE); if (__glibc_likely (! not_first_call)) diff --git a/nptl/pthread_mutex_unlock.c b/nptl/pthread_mutex_unlock.c index db99175dbba1cbd5e6fbdd273a0995ed8ed7920b..27c5f539a636a1530155f843aadc69ada73432f3 100644 --- a/nptl/pthread_mutex_unlock.c +++ b/nptl/pthread_mutex_unlock.c @@ -171,7 +171,7 @@ __pthread_mutex_unlock_full (pthread_mutex_t *mutex, int decr) The unlock operation must be the last access to the mutex to not violate the mutex destruction requirements (see __lll_unlock). */ private = PTHREAD_ROBUST_MUTEX_PSHARED (mutex); - if (__glibc_unlikely ((atomic_exchange_rel (&mutex->__data.__lock, 0) + if (__glibc_unlikely ((atomic_exchange_release (&mutex->__data.__lock, 0) & FUTEX_WAITERS) != 0)) futex_wake ((unsigned int *) &mutex->__data.__lock, 1, private); diff --git a/sysdeps/aarch64/atomic-machine.h b/sysdeps/aarch64/atomic-machine.h index 52b3fb2047cbf2518644b1595ed9a11cddcc89d2..459deeec18713a374bbe186bf84b0c366896a8d7 100644 --- a/sysdeps/aarch64/atomic-machine.h +++ b/sysdeps/aarch64/atomic-machine.h @@ -103,28 +103,6 @@ __atomic_val_bysize (__arch_compare_and_exchange_val, int, \ mem, new, old, __ATOMIC_RELEASE) - -/* Atomic exchange (without compare). */ - -# define __arch_exchange_8_int(mem, newval, model) \ - __atomic_exchange_n (mem, newval, model) - -# define __arch_exchange_16_int(mem, newval, model) \ - __atomic_exchange_n (mem, newval, model) - -# define __arch_exchange_32_int(mem, newval, model) \ - __atomic_exchange_n (mem, newval, model) - -# define __arch_exchange_64_int(mem, newval, model) \ - __atomic_exchange_n (mem, newval, model) - -# define atomic_exchange_acq(mem, value) \ - __atomic_val_bysize (__arch_exchange, int, mem, value, __ATOMIC_ACQUIRE) - -# define atomic_exchange_rel(mem, value) \ - __atomic_val_bysize (__arch_exchange, int, mem, value, __ATOMIC_RELEASE) - - /* Atomically add value and return the previous (unincremented) value. */ # define __arch_exchange_and_add_8_int(mem, value, model) \ diff --git a/sysdeps/aarch64/nptl/tls.h b/sysdeps/aarch64/nptl/tls.h index 8d62b31e23d53ff2789bb32a828eac2254434679..08aa2eff891b7be32243e9955d998892807c7b2e 100644 --- a/sysdeps/aarch64/nptl/tls.h +++ b/sysdeps/aarch64/nptl/tls.h @@ -98,7 +98,7 @@ typedef struct # define THREAD_GSCOPE_RESET_FLAG() \ do \ { int __res \ - = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \ + = atomic_exchange_release (&THREAD_SELF->header.gscope_flag, \ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \ diff --git a/sysdeps/alpha/nptl/tls.h b/sysdeps/alpha/nptl/tls.h index ddf7de0705b37be20dbd7c981ff79e36659e0439..8f5b69ad3b1b0c557fa1bae55278547572a374cc 100644 --- a/sysdeps/alpha/nptl/tls.h +++ b/sysdeps/alpha/nptl/tls.h @@ -95,7 +95,7 @@ typedef struct #define THREAD_GSCOPE_RESET_FLAG() \ do \ { int __res \ - = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \ + = atomic_exchange_release (&THREAD_SELF->header.gscope_flag, \ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \ diff --git a/sysdeps/arc/nptl/tls.h b/sysdeps/arc/nptl/tls.h index 15adfc94918dda2364ab5321d3a6ce5693ba4ad4..7fc6602b236fa2455f8de4a0540442ae85d27c98 100644 --- a/sysdeps/arc/nptl/tls.h +++ b/sysdeps/arc/nptl/tls.h @@ -103,7 +103,7 @@ typedef struct #define THREAD_GSCOPE_RESET_FLAG() \ do \ { int __res \ - = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \ + = atomic_exchange_release (&THREAD_SELF->header.gscope_flag, \ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \ diff --git a/sysdeps/arm/nptl/tls.h b/sysdeps/arm/nptl/tls.h index 02d9be202d77b9ec871a52be5a4e49feffc300b1..7657ca3dccc2d929c71236d42fc060a4b4902e2b 100644 --- a/sysdeps/arm/nptl/tls.h +++ b/sysdeps/arm/nptl/tls.h @@ -89,7 +89,7 @@ typedef struct #define THREAD_GSCOPE_RESET_FLAG() \ do \ { int __res \ - = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \ + = atomic_exchange_release (&THREAD_SELF->header.gscope_flag, \ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \ diff --git a/sysdeps/csky/nptl/tls.h b/sysdeps/csky/nptl/tls.h index cd135d546444e2e8f8ce0d53d5a16e2b13709bb9..58d6ab0fb2ae90de50cffd5b4a98426c6a793050 100644 --- a/sysdeps/csky/nptl/tls.h +++ b/sysdeps/csky/nptl/tls.h @@ -118,7 +118,7 @@ typedef struct # define THREAD_GSCOPE_RESET_FLAG() \ do \ { int __res \ - = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \ + = atomic_exchange_release (&THREAD_SELF->header.gscope_flag, \ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \ diff --git a/sysdeps/hppa/nptl/pthread_spin_init.c b/sysdeps/hppa/nptl/pthread_spin_init.c index aca5e01fced74695b38d94fa66026df15607be01..f2a2009daa17043541a13bb1f64b5b255c83050c 100644 --- a/sysdeps/hppa/nptl/pthread_spin_init.c +++ b/sysdeps/hppa/nptl/pthread_spin_init.c @@ -23,7 +23,7 @@ __pthread_spin_init (pthread_spinlock_t *lock, int pshared) { /* CONCURRENCTY NOTES: - The atomic_exchange_rel synchronizes-with the atomic_exhange_acq in + The atomic_exchange_release synchronizes-with the atomic_exhange_acq in pthread_spin_lock. On hppa we must not use a plain `stw` to reset the guard lock. This @@ -40,7 +40,7 @@ __pthread_spin_init (pthread_spinlock_t *lock, int pshared) Therefore if a variable is used in an atomic macro it must always be manipulated with atomic macros in order for memory ordering rules to be preserved. */ - atomic_exchange_rel (lock, 0); + atomic_exchange_release (lock, 0); return 0; } versioned_symbol (libc, __pthread_spin_init, pthread_spin_init, diff --git a/sysdeps/hppa/nptl/pthread_spin_unlock.c b/sysdeps/hppa/nptl/pthread_spin_unlock.c index 5639ec84ec3e058438f0407b3f5da4cb62de1b37..885ce2b2ba7b679a8ec06ef24d8e4cdff22c2798 100644 --- a/sysdeps/hppa/nptl/pthread_spin_unlock.c +++ b/sysdeps/hppa/nptl/pthread_spin_unlock.c @@ -23,7 +23,7 @@ __pthread_spin_unlock (pthread_spinlock_t *lock) { /* CONCURRENCTY NOTES: - The atomic_exchange_rel synchronizes-with the atomic_exhange_acq in + The atomic_exchange_release synchronizes-with the atomic_exhange_acq in pthread_spin_lock. On hppa we must not use a plain `stw` to reset the guard lock. This @@ -40,7 +40,7 @@ __pthread_spin_unlock (pthread_spinlock_t *lock) Therefore if a variable is used in an atomic macro it must always be manipulated with atomic macros in order for memory ordering rules to be preserved. */ - atomic_exchange_rel (lock, 0); + atomic_exchange_release (lock, 0); return 0; } versioned_symbol (libc, __pthread_spin_unlock, pthread_spin_unlock, diff --git a/sysdeps/hppa/nptl/tls.h b/sysdeps/hppa/nptl/tls.h index 204960d524246af3e8be40ecad20ffb567f2dc6d..e6b0bd5c7182b497aaf0d2bb08f62551a223c403 100644 --- a/sysdeps/hppa/nptl/tls.h +++ b/sysdeps/hppa/nptl/tls.h @@ -123,7 +123,7 @@ static inline void __set_cr27(struct pthread *cr27) #define THREAD_GSCOPE_RESET_FLAG() \ do \ { int __res \ - = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \ + = atomic_exchange_release (&THREAD_SELF->header.gscope_flag, \ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \ diff --git a/sysdeps/ia64/nptl/tls.h b/sysdeps/ia64/nptl/tls.h index 8ccedb73e610095337b8a082ee0742866ac4e2f8..d2411b3c1ac29733c0bb3683d83388e2e0e8e277 100644 --- a/sysdeps/ia64/nptl/tls.h +++ b/sysdeps/ia64/nptl/tls.h @@ -147,7 +147,7 @@ register struct pthread *__thread_self __asm__("r13"); #define THREAD_GSCOPE_RESET_FLAG() \ do \ { int __res \ - = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \ + = atomic_exchange_release (&THREAD_SELF->header.gscope_flag, \ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \ diff --git a/sysdeps/m68k/nptl/tls.h b/sysdeps/m68k/nptl/tls.h index 30d58e36e9552d1776fffe071653c78a8012408b..742e1b6767d99fa6011ac1d207264c7b82e53787 100644 --- a/sysdeps/m68k/nptl/tls.h +++ b/sysdeps/m68k/nptl/tls.h @@ -122,7 +122,7 @@ extern void * __m68k_read_tp (void); #define THREAD_GSCOPE_RESET_FLAG() \ do \ { int __res \ - = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \ + = atomic_exchange_release (&THREAD_SELF->header.gscope_flag, \ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \ diff --git a/sysdeps/microblaze/nptl/tls.h b/sysdeps/microblaze/nptl/tls.h index 40a6acd71e710c35f2b8ef2495fdeb34906f9517..588fd1c5d63ee4e6a1b284cc19e216b6730a2091 100644 --- a/sysdeps/microblaze/nptl/tls.h +++ b/sysdeps/microblaze/nptl/tls.h @@ -100,7 +100,7 @@ typedef struct # define THREAD_GSCOPE_RESET_FLAG() \ do \ { int __res \ - = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \ + = atomic_exchange_release (&THREAD_SELF->header.gscope_flag, \ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \ diff --git a/sysdeps/mips/nptl/tls.h b/sysdeps/mips/nptl/tls.h index 03a5b24abd5d1d6254418e79cb231b03cee72d99..2aa7cb4bb8d0b5a31889aa33d5751104ff1e4f45 100644 --- a/sysdeps/mips/nptl/tls.h +++ b/sysdeps/mips/nptl/tls.h @@ -150,7 +150,7 @@ typedef struct #define THREAD_GSCOPE_RESET_FLAG() \ do \ { int __res \ - = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \ + = atomic_exchange_release (&THREAD_SELF->header.gscope_flag, \ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \ diff --git a/sysdeps/nios2/nptl/tls.h b/sysdeps/nios2/nptl/tls.h index 18080275ef7458c80c7826fc0fa0f6a4fadac320..cb231e2a4bbfa52495c4c017a7d3e1c6dd7937ca 100644 --- a/sysdeps/nios2/nptl/tls.h +++ b/sysdeps/nios2/nptl/tls.h @@ -130,7 +130,7 @@ register struct pthread *__thread_self __asm__("r23"); #define THREAD_GSCOPE_RESET_FLAG() \ do \ { int __res \ - = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \ + = atomic_exchange_release (&THREAD_SELF->header.gscope_flag, \ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \ diff --git a/sysdeps/nptl/futex-internal.h b/sysdeps/nptl/futex-internal.h index cf54c27ed9d5780cd9a9166878fdc5a204c0b64f..f64728b3988aeede7e5f29ef286abaca0d705744 100644 --- a/sysdeps/nptl/futex-internal.h +++ b/sysdeps/nptl/futex-internal.h @@ -319,7 +319,7 @@ __futex_clocklock64 (int *futex, clockid_t clockid, { if (__glibc_unlikely (atomic_compare_and_exchange_bool_acq (futex, 1, 0))) { - while (atomic_exchange_acq (futex, 2) != 0) + while (atomic_exchange_acquire (futex, 2) != 0) { int err = 0; err = __futex_abstimed_wait64 ((unsigned int *) futex, 2, clockid, diff --git a/sysdeps/nptl/lowlevellock.h b/sysdeps/nptl/lowlevellock.h index b429d9aa780f3c5ca6e4ae0f8e4e31e6ef8950f2..29aa9adb89e5f6291b30b9435201d597b58cb595 100644 --- a/sysdeps/nptl/lowlevellock.h +++ b/sysdeps/nptl/lowlevellock.h @@ -119,7 +119,7 @@ libc_hidden_proto (__lll_lock_wait) ((void) \ ({ \ int *__futex = (futex); \ - if (__glibc_unlikely (atomic_exchange_acq (__futex, 2) != 0)) \ + if (__glibc_unlikely (atomic_exchange_acquire (__futex, 2) != 0)) \ __lll_lock_wait (__futex, private); \ })) #define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private) @@ -147,7 +147,7 @@ libc_hidden_proto (__lll_lock_wake) ({ \ int *__futex = (futex); \ int __private = (private); \ - int __oldval = atomic_exchange_rel (__futex, 0); \ + int __oldval = atomic_exchange_release (__futex, 0); \ if (__glibc_unlikely (__oldval > 1)) \ { \ if (__builtin_constant_p (private) && (private) == LLL_PRIVATE) \ diff --git a/sysdeps/or1k/nptl/tls.h b/sysdeps/or1k/nptl/tls.h index c6ffe62c3f8c1ae330e6402640294cbc18714883..e82f444738de222c0e4866d5a2ab8191ce99ddc9 100644 --- a/sysdeps/or1k/nptl/tls.h +++ b/sysdeps/or1k/nptl/tls.h @@ -164,7 +164,7 @@ register tcbhead_t *__thread_self __asm__("r10"); #define THREAD_GSCOPE_RESET_FLAG() \ do \ { \ - int __res = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,\ + int __res = atomic_exchange_release (&THREAD_SELF->header.gscope_flag,\ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, \ diff --git a/sysdeps/posix/libc_fatal.c b/sysdeps/posix/libc_fatal.c index 2ee0010b8dbee26dcc10d5cffab1b410c0446b31..b37423d681c09321e5969e81e32f88f33f675ecb 100644 --- a/sysdeps/posix/libc_fatal.c +++ b/sysdeps/posix/libc_fatal.c @@ -140,8 +140,8 @@ __libc_message (enum __libc_message_action action, const char *fmt, ...) /* We have to free the old buffer since the application might catch the SIGABRT signal. */ - struct abort_msg_s *old = atomic_exchange_acq (&__abort_msg, - buf); + struct abort_msg_s *old = + atomic_exchange_acquire (&__abort_msg, buf); if (old != NULL) __munmap (old, old->size); } diff --git a/sysdeps/powerpc/nptl/tls.h b/sysdeps/powerpc/nptl/tls.h index 22b00752350196ad7e6d0fbdcafdc271f0af5bed..e62a96238aa95c79ac1f749b4dbf03985b6e15d4 100644 --- a/sysdeps/powerpc/nptl/tls.h +++ b/sysdeps/powerpc/nptl/tls.h @@ -214,7 +214,7 @@ typedef struct #define THREAD_GSCOPE_RESET_FLAG() \ do \ { int __res \ - = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \ + = atomic_exchange_release (&THREAD_SELF->header.gscope_flag, \ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \ diff --git a/sysdeps/riscv/nptl/tls.h b/sysdeps/riscv/nptl/tls.h index 4e586f348adf6556151c850e983bbcaa42a91b0f..700c2f51899b0385d7ebaa4810c84de4fa6f2b45 100644 --- a/sysdeps/riscv/nptl/tls.h +++ b/sysdeps/riscv/nptl/tls.h @@ -113,7 +113,7 @@ typedef struct # define THREAD_GSCOPE_RESET_FLAG() \ do \ { int __res \ - = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \ + = atomic_exchange_release (&THREAD_SELF->header.gscope_flag, \ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \ diff --git a/sysdeps/s390/atomic-machine.h b/sysdeps/s390/atomic-machine.h index 6b1de51c2a30baf5554a729a80a7ce04b56fc22c..fe7f04cf30cf5b62fea743a72384f8fc248d2d25 100644 --- a/sysdeps/s390/atomic-machine.h +++ b/sysdeps/s390/atomic-machine.h @@ -71,14 +71,6 @@ 1, __ATOMIC_ACQUIRE, \ __ATOMIC_RELAXED); }) -/* Store NEWVALUE in *MEM and return the old value. */ -#define atomic_exchange_acq(mem, newvalue) \ - ({ __atomic_check_size((mem)); \ - __atomic_exchange_n (mem, newvalue, __ATOMIC_ACQUIRE); }) -#define atomic_exchange_rel(mem, newvalue) \ - ({ __atomic_check_size((mem)); \ - __atomic_exchange_n (mem, newvalue, __ATOMIC_RELEASE); }) - /* Add VALUE to *MEM and return the old value of *MEM. */ /* The gcc builtin uses load-and-add instruction on z196 zarch and higher cpus instead of a loop with compare-and-swap instruction. */ diff --git a/sysdeps/s390/nptl/tls.h b/sysdeps/s390/nptl/tls.h index ff210ffeb25a140bb19dbf54ab299350dc261ac7..98d7870148ce6bc1d6397b1465dfabe96f7280b2 100644 --- a/sysdeps/s390/nptl/tls.h +++ b/sysdeps/s390/nptl/tls.h @@ -157,7 +157,7 @@ typedef struct #define THREAD_GSCOPE_RESET_FLAG() \ do \ { int __res \ - = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \ + = atomic_exchange_release (&THREAD_SELF->header.gscope_flag, \ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \ diff --git a/sysdeps/sh/nptl/tls.h b/sysdeps/sh/nptl/tls.h index 76591ab6ef6c12b73dda0feb18ab5adfbf53c28e..1530489a6ce4286bc5146e6cd83e3b463b965467 100644 --- a/sysdeps/sh/nptl/tls.h +++ b/sysdeps/sh/nptl/tls.h @@ -129,7 +129,7 @@ typedef struct #define THREAD_GSCOPE_RESET_FLAG() \ do \ { int __res \ - = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \ + = atomic_exchange_release (&THREAD_SELF->header.gscope_flag, \ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \ diff --git a/sysdeps/sparc/nptl/tls.h b/sysdeps/sparc/nptl/tls.h index d1e2bb4ad192cc7c825fd62b03bec45bc537aaf6..95a69cb8249dc79c3a063637a21d976d2660c48f 100644 --- a/sysdeps/sparc/nptl/tls.h +++ b/sysdeps/sparc/nptl/tls.h @@ -130,7 +130,7 @@ register struct pthread *__thread_self __asm__("%g7"); #define THREAD_GSCOPE_RESET_FLAG() \ do \ { int __res \ - = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \ + = atomic_exchange_release (&THREAD_SELF->header.gscope_flag, \ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \ diff --git a/sysdeps/unix/sysv/linux/riscv/atomic-machine.h b/sysdeps/unix/sysv/linux/riscv/atomic-machine.h index f4b2cbced828a80335887bf172fd60767cf978ac..a3eff1134ac2bed7e1e14de961cf77b8b1a33ce5 100644 --- a/sysdeps/unix/sysv/linux/riscv/atomic-machine.h +++ b/sysdeps/unix/sysv/linux/riscv/atomic-machine.h @@ -118,12 +118,6 @@ # define __arch_exchange_64_int(mem, newval, model) \ __atomic_exchange_n (mem, newval, model) -# define atomic_exchange_acq(mem, value) \ - __atomic_val_bysize (__arch_exchange, int, mem, value, __ATOMIC_ACQUIRE) - -# define atomic_exchange_rel(mem, value) \ - __atomic_val_bysize (__arch_exchange, int, mem, value, __ATOMIC_RELEASE) - /* Atomically add value and return the previous (unincremented) value. */ # define __arch_exchange_and_add_8_int(mem, value, model) \ diff --git a/sysdeps/x86/atomic-machine.h b/sysdeps/x86/atomic-machine.h index ffd059618878be42c05fb21cd51b7434a6f37637..c27a437ec1b129fc18ca832708a69627959fc107 100644 --- a/sysdeps/x86/atomic-machine.h +++ b/sysdeps/x86/atomic-machine.h @@ -95,34 +95,6 @@ #endif -/* Note that we need no lock prefix. */ -#define atomic_exchange_acq(mem, newvalue) \ - ({ __typeof (*mem) result; \ - if (sizeof (*mem) == 1) \ - __asm __volatile ("xchgb %b0, %1" \ - : "=q" (result), "=m" (*mem) \ - : "0" (newvalue), "m" (*mem)); \ - else if (sizeof (*mem) == 2) \ - __asm __volatile ("xchgw %w0, %1" \ - : "=r" (result), "=m" (*mem) \ - : "0" (newvalue), "m" (*mem)); \ - else if (sizeof (*mem) == 4) \ - __asm __volatile ("xchgl %0, %1" \ - : "=r" (result), "=m" (*mem) \ - : "0" (newvalue), "m" (*mem)); \ - else if (__HAVE_64B_ATOMICS) \ - __asm __volatile ("xchgq %q0, %1" \ - : "=r" (result), "=m" (*mem) \ - : "0" ((int64_t) cast_to_integer (newvalue)), \ - "m" (*mem)); \ - else \ - { \ - result = 0; \ - __atomic_link_error (); \ - } \ - result; }) - - #define __arch_exchange_and_add_body(lock, pfx, mem, value) \ ({ __typeof (*mem) __result; \ __typeof (value) __addval = (value); \