Add comment that 64b atomics need to work with either LP64 or ILP32.

Message ID 1421954320.4572.63.camel@triegel.csb
State Dropped
Headers

Commit Message

Torvald Riegel Jan. 22, 2015, 7:18 p.m. UTC
  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  <triegel@redhat.com>

	* include/atomic.h: Add comment.
  

Patch

commit 21a5dd093a8a5c7985e7fd0f9a7f8f1ba2cc4a4e
Author: Torvald Riegel <triegel@redhat.com>
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