From patchwork Thu Jan 22 19:18:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Torvald Riegel X-Patchwork-Id: 4767 Received: (qmail 2475 invoked by alias); 22 Jan 2015 19:25:15 -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 29175 invoked by uid 89); 22 Jan 2015 19:23:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Subject: [PATCH] Add comment that 64b atomics need to work with either LP64 or ILP32. From: Torvald Riegel To: GLIBC Devel Cc: "Joseph S. Myers" Date: Thu, 22 Jan 2015 20:18:40 +0100 Message-ID: <1421954320.4572.63.camel@triegel.csb> Mime-Version: 1.0 This just adds a comment that even if 64b atomics are supported, the code still needs to work under both LP64 and ILP32. I'm not aware of a general rule for supporting just LP64 or ILP32, but it's what seems to result from the assumptions Joseph listed. I suppose this is useful irrespective of Joseph's comment that moving to stdint.h types generally would be useful; that would be future clean-up, and even then there might be cases where we can't include stdint.h easily (exposed headers, perhaps?). Thoughts? 2015-01-22 Torvald Riegel * include/atomic.h: Add comment. commit 21a5dd093a8a5c7985e7fd0f9a7f8f1ba2cc4a4e Author: Torvald Riegel Date: Thu Jan 22 20:12:43 2015 +0100 Add comment that 64b atomics need to work with either LP64 or ILP32. diff --git a/include/atomic.h b/include/atomic.h index 7fd70c4..212b292 100644 --- a/include/atomic.h +++ b/include/atomic.h @@ -542,7 +542,9 @@ ({ __typeof (x) __x; __asm ("" : "=r" (__x) : "0" (x)); __x; }) #endif -/* This is equal to 1 iff the architecture supports 64b atomic operations. */ +/* This is equal to 1 iff the architecture supports 64b atomic operations. + Note that if it does, we still need to support LP64 and ILP32 data + models. */ #ifndef __HAVE_64B_ATOMICS #error Unable to determine if 64-bit atomics are present. #endif