Remove android_... store_barriers and 64-bit atomics.

These are no longer used, and we want to strongly discourage future use.
Keep the 32-bit variants while there are still uses.  All users should move
to C11 or C++11 atomics.

(Resolved conflicts in atomic-...64.h with uniprocessor support
removal as in AOSP.)

Bug:16880454

Change-Id: I122b541cfd29ef4a6c932647f85d0d6a9d802061
(cherry picked from commit 9959ed953069ac9a7f08bebd2df55440e9370c0f)
diff --git a/include/cutils/atomic-arm.h b/include/cutils/atomic-arm.h
index 172a0cd..6b031b6 100644
--- a/include/cutils/atomic-arm.h
+++ b/include/cutils/atomic-arm.h
@@ -37,15 +37,6 @@
 #endif
 }
 
-extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier()
-{
-#if ANDROID_SMP == 0
-    android_compiler_barrier();
-#else
-    __asm__ __volatile__ ("dmb st" : : : "memory");
-#endif
-}
-
 extern ANDROID_ATOMIC_INLINE
 int32_t android_atomic_acquire_load(volatile const int32_t *ptr)
 {
diff --git a/include/cutils/atomic-arm64.h b/include/cutils/atomic-arm64.h
index 4562ad0..7ae47d7 100644
--- a/include/cutils/atomic-arm64.h
+++ b/include/cutils/atomic-arm64.h
@@ -46,29 +46,11 @@
     __asm__ __volatile__ ("" : : : "memory");
 }
 
-#if ANDROID_SMP == 0
-extern ANDROID_ATOMIC_INLINE
-void android_memory_barrier(void)
-{
-    android_compiler_barrier();
-}
-extern ANDROID_ATOMIC_INLINE
-void android_memory_store_barrier(void)
-{
-    android_compiler_barrier();
-}
-#else
 extern ANDROID_ATOMIC_INLINE
 void android_memory_barrier(void)
 {
     __asm__ __volatile__ ("dmb ish" : : : "memory");
 }
-extern ANDROID_ATOMIC_INLINE
-void android_memory_store_barrier(void)
-{
-    __asm__ __volatile__ ("dmb ishst" : : : "memory");
-}
-#endif
 
 extern ANDROID_ATOMIC_INLINE
 int32_t android_atomic_acquire_load(volatile const int32_t *ptr)
@@ -79,14 +61,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-int64_t android_atomic_acquire_load64(volatile const int64_t *ptr)
-{
-    int64_t value = *ptr;
-    android_memory_barrier();
-    return value;
-}
-
-extern ANDROID_ATOMIC_INLINE
 int32_t android_atomic_release_load(volatile const int32_t *ptr)
 {
     android_memory_barrier();
@@ -94,13 +68,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-int64_t android_atomic_release_load64(volatile const int64_t *ptr)
-{
-    android_memory_barrier();
-    return *ptr;
-}
-
-extern ANDROID_ATOMIC_INLINE
 void android_atomic_acquire_store(int32_t value, volatile int32_t *ptr)
 {
     *ptr = value;
@@ -108,13 +75,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-void android_atomic_acquire_store64(int64_t value, volatile int64_t *ptr)
-{
-    *ptr = value;
-    android_memory_barrier();
-}
-
-extern ANDROID_ATOMIC_INLINE
 void android_atomic_release_store(int32_t value, volatile int32_t *ptr)
 {
     android_memory_barrier();
@@ -122,13 +82,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-void android_atomic_release_store64(int64_t value, volatile int64_t *ptr)
-{
-    android_memory_barrier();
-    *ptr = value;
-}
-
-extern ANDROID_ATOMIC_INLINE
 int android_atomic_cas(int32_t old_value, int32_t new_value,
                        volatile int32_t *ptr)
 {
@@ -136,13 +89,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-int64_t android_atomic_cas64(int64_t old_value, int64_t new_value,
-                             volatile int64_t *ptr)
-{
-    return __sync_val_compare_and_swap(ptr, old_value, new_value) != old_value;
-}
-
-extern ANDROID_ATOMIC_INLINE
 int android_atomic_acquire_cas(int32_t old_value, int32_t new_value,
                                volatile int32_t *ptr)
 {
@@ -152,15 +98,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-int64_t android_atomic_acquire_cas64(int64_t old_value, int64_t new_value,
-                                     volatile int64_t *ptr)
-{
-    int status = android_atomic_cas64(old_value, new_value, ptr);
-    android_memory_barrier();
-    return status;
-}
-
-extern ANDROID_ATOMIC_INLINE
 int android_atomic_release_cas(int32_t old_value, int32_t new_value,
                                volatile int32_t *ptr)
 {
@@ -169,14 +106,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-int64_t android_atomic_release_cas64(int64_t old_value, int64_t new_value,
-                                     volatile int64_t *ptr)
-{
-    android_memory_barrier();
-    return android_atomic_cas64(old_value, new_value, ptr);
-}
-
-extern ANDROID_ATOMIC_INLINE
 int32_t android_atomic_add(int32_t increment, volatile int32_t *ptr)
 {
     int32_t prev, status;
diff --git a/include/cutils/atomic-inline.h b/include/cutils/atomic-inline.h
index 007a905..a31e913 100644
--- a/include/cutils/atomic-inline.h
+++ b/include/cutils/atomic-inline.h
@@ -65,12 +65,6 @@
 #define ANDROID_MEMBAR_FULL android_memory_barrier
 #endif
 
-#if ANDROID_SMP == 0
-#define ANDROID_MEMBAR_STORE android_compiler_barrier
-#else
-#define ANDROID_MEMBAR_STORE android_memory_store_barrier
-#endif
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/cutils/atomic-mips.h b/include/cutils/atomic-mips.h
index 1ed833d..5d4f097 100644
--- a/include/cutils/atomic-mips.h
+++ b/include/cutils/atomic-mips.h
@@ -33,19 +33,11 @@
 {
     android_compiler_barrier();
 }
-extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void)
-{
-    android_compiler_barrier();
-}
 #else
 extern ANDROID_ATOMIC_INLINE void android_memory_barrier(void)
 {
     __asm__ __volatile__ ("sync" : : : "memory");
 }
-extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void)
-{
-    __asm__ __volatile__ ("sync" : : : "memory");
-}
 #endif
 
 extern ANDROID_ATOMIC_INLINE int32_t
diff --git a/include/cutils/atomic-mips64.h b/include/cutils/atomic-mips64.h
index 99bbe3a..9d8f65e 100644
--- a/include/cutils/atomic-mips64.h
+++ b/include/cutils/atomic-mips64.h
@@ -28,25 +28,10 @@
     __asm__ __volatile__ ("" : : : "memory");
 }
 
-#if ANDROID_SMP == 0
-extern ANDROID_ATOMIC_INLINE void android_memory_barrier(void)
-{
-    android_compiler_barrier();
-}
-extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void)
-{
-    android_compiler_barrier();
-}
-#else
 extern ANDROID_ATOMIC_INLINE void android_memory_barrier(void)
 {
     __asm__ __volatile__ ("sync" : : : "memory");
 }
-extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void)
-{
-    __asm__ __volatile__ ("sync" : : : "memory");
-}
-#endif
 
 extern ANDROID_ATOMIC_INLINE
 int32_t android_atomic_acquire_load(volatile const int32_t *ptr)
@@ -57,14 +42,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-int64_t android_atomic_acquire_load64(volatile const int64_t *ptr)
-{
-    int64_t value = *ptr;
-    android_memory_barrier();
-    return value;
-}
-
-extern ANDROID_ATOMIC_INLINE
 int32_t android_atomic_release_load(volatile const int32_t *ptr)
 {
     android_memory_barrier();
@@ -72,13 +49,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-int64_t android_atomic_release_load64(volatile const int64_t *ptr)
-{
-    android_memory_barrier();
-    return *ptr;
-}
-
-extern ANDROID_ATOMIC_INLINE
 void android_atomic_acquire_store(int32_t value, volatile int32_t *ptr)
 {
     *ptr = value;
@@ -86,13 +56,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-void android_atomic_acquire_store64(int64_t value, volatile int64_t *ptr)
-{
-    *ptr = value;
-    android_memory_barrier();
-}
-
-extern ANDROID_ATOMIC_INLINE
 void android_atomic_release_store(int32_t value, volatile int32_t *ptr)
 {
     android_memory_barrier();
@@ -100,13 +63,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-void android_atomic_release_store64(int64_t value, volatile int64_t *ptr)
-{
-    android_memory_barrier();
-    *ptr = value;
-}
-
-extern ANDROID_ATOMIC_INLINE
 int android_atomic_cas(int32_t old_value, int32_t new_value, volatile int32_t *ptr)
 {
     int32_t prev, status;
@@ -126,13 +82,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-int64_t android_atomic_cas64(int64_t old_value, int64_t new_value,
-                             volatile int64_t *ptr)
-{
-    return __sync_val_compare_and_swap(ptr, old_value, new_value) != old_value;
-}
-
-extern ANDROID_ATOMIC_INLINE
 int android_atomic_acquire_cas(int32_t old_value,
                            int32_t new_value,
                            volatile int32_t *ptr)
@@ -143,15 +92,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-int64_t android_atomic_acquire_cas64(int64_t old_value, int64_t new_value,
-                                     volatile int64_t *ptr)
-{
-    int status = android_atomic_cas64(old_value, new_value, ptr);
-    android_memory_barrier();
-    return status;
-}
-
-extern ANDROID_ATOMIC_INLINE
 int android_atomic_release_cas(int32_t old_value,
                            int32_t new_value,
                            volatile int32_t *ptr)
@@ -161,14 +101,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-int64_t android_atomic_release_cas64(int64_t old_value, int64_t new_value,
-                                     volatile int64_t *ptr)
-{
-    android_memory_barrier();
-    return android_atomic_cas64(old_value, new_value, ptr);
-}
-
-extern ANDROID_ATOMIC_INLINE
 int32_t android_atomic_add(int32_t increment, volatile int32_t *ptr)
 {
     int32_t prev, status;
diff --git a/include/cutils/atomic-x86.h b/include/cutils/atomic-x86.h
index 9480f57..06bf1a3 100644
--- a/include/cutils/atomic-x86.h
+++ b/include/cutils/atomic-x86.h
@@ -33,19 +33,11 @@
 {
     android_compiler_barrier();
 }
-extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void)
-{
-    android_compiler_barrier();
-}
 #else
 extern ANDROID_ATOMIC_INLINE void android_memory_barrier(void)
 {
     __asm__ __volatile__ ("mfence" : : : "memory");
 }
-extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void)
-{
-    android_compiler_barrier();
-}
 #endif
 
 extern ANDROID_ATOMIC_INLINE int32_t
diff --git a/include/cutils/atomic-x86_64.h b/include/cutils/atomic-x86_64.h
index 5b5c203..99cb070 100644
--- a/include/cutils/atomic-x86_64.h
+++ b/include/cutils/atomic-x86_64.h
@@ -41,29 +41,11 @@
     __asm__ __volatile__ ("" : : : "memory");
 }
 
-#if ANDROID_SMP == 0
-extern ANDROID_ATOMIC_INLINE
-void android_memory_barrier(void)
-{
-    android_compiler_barrier();
-}
-extern ANDROID_ATOMIC_INLINE
-void android_memory_store_barrier(void)
-{
-    android_compiler_barrier();
-}
-#else
 extern ANDROID_ATOMIC_INLINE
 void android_memory_barrier(void)
 {
     __asm__ __volatile__ ("mfence" : : : "memory");
 }
-extern ANDROID_ATOMIC_INLINE
-void android_memory_store_barrier(void)
-{
-    android_compiler_barrier();
-}
-#endif
 
 extern ANDROID_ATOMIC_INLINE
 int32_t android_atomic_acquire_load(volatile const int32_t *ptr)
@@ -74,14 +56,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-int64_t android_atomic_acquire_load64(volatile const int64_t *ptr)
-{
-    int64_t value = *ptr;
-    android_compiler_barrier();
-    return value;
-}
-
-extern ANDROID_ATOMIC_INLINE
 int32_t android_atomic_release_load(volatile const int32_t *ptr)
 {
     android_memory_barrier();
@@ -89,13 +63,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-int64_t android_atomic_release_load64(volatile const int64_t *ptr)
-{
-    android_memory_barrier();
-    return *ptr;
-}
-
-extern ANDROID_ATOMIC_INLINE
 void android_atomic_acquire_store(int32_t value, volatile int32_t *ptr)
 {
     *ptr = value;
@@ -103,13 +70,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-void android_atomic_acquire_store64(int64_t value, volatile int64_t *ptr)
-{
-    *ptr = value;
-    android_memory_barrier();
-}
-
-extern ANDROID_ATOMIC_INLINE
 void android_atomic_release_store(int32_t value, volatile int32_t *ptr)
 {
     android_compiler_barrier();
@@ -117,13 +77,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-void android_atomic_release_store64(int64_t value, volatile int64_t *ptr)
-{
-    android_compiler_barrier();
-    *ptr = value;
-}
-
-extern ANDROID_ATOMIC_INLINE
 int android_atomic_cas(int32_t old_value, int32_t new_value,
                        volatile int32_t *ptr)
 {
@@ -136,18 +89,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-int64_t android_atomic_cas64(int64_t old_value, int64_t new_value,
-                             volatile int64_t *ptr)
-{
-    int64_t prev;
-    __asm__ __volatile__ ("lock; cmpxchgq %1, %2"
-                          : "=a" (prev)
-                          : "q" (new_value), "m" (*ptr), "0" (old_value)
-                          : "memory");
-    return prev != old_value;
-}
-
-extern ANDROID_ATOMIC_INLINE
 int android_atomic_acquire_cas(int32_t old_value, int32_t new_value,
                                volatile int32_t *ptr)
 {
@@ -156,14 +97,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-int64_t android_atomic_acquire_cas64(int64_t old_value, int64_t new_value,
-                                     volatile int64_t *ptr)
-{
-    /* Loads are not reordered with other loads. */
-    return android_atomic_cas64(old_value, new_value, ptr);
-}
-
-extern ANDROID_ATOMIC_INLINE
 int android_atomic_release_cas(int32_t old_value, int32_t new_value,
                                volatile int32_t *ptr)
 {
@@ -172,14 +105,6 @@
 }
 
 extern ANDROID_ATOMIC_INLINE
-int64_t android_atomic_release_cas64(int64_t old_value, int64_t new_value,
-                                     volatile int64_t *ptr)
-{
-    /* Stores are not reordered with other stores. */
-    return android_atomic_cas64(old_value, new_value, ptr);
-}
-
-extern ANDROID_ATOMIC_INLINE
 int32_t android_atomic_add(int32_t increment, volatile int32_t *ptr)
 {
     __asm__ __volatile__ ("lock; xaddl %0, %1"
diff --git a/include/cutils/atomic.h b/include/cutils/atomic.h
index b9b18c4..79409a7 100644
--- a/include/cutils/atomic.h
+++ b/include/cutils/atomic.h
@@ -103,11 +103,6 @@
 int32_t android_atomic_acquire_load(volatile const int32_t* addr);
 int32_t android_atomic_release_load(volatile const int32_t* addr);
 
-#if defined (__LP64__)
-int64_t android_atomic_acquire_load64(volatile const int64_t* addr);
-int64_t android_atomic_release_load64(volatile const int64_t* addr);
-#endif
-
 /*
  * Perform an atomic store with "acquire" or "release" ordering.
  *
@@ -125,11 +120,6 @@
 void android_atomic_acquire_store(int32_t value, volatile int32_t* addr);
 void android_atomic_release_store(int32_t value, volatile int32_t* addr);
 
-#if defined (__LP64__)
-void android_atomic_acquire_store64(int64_t value, volatile int64_t* addr);
-void android_atomic_release_store64(int64_t value, volatile int64_t* addr);
-#endif
-
 /*
  * Compare-and-set operation with "acquire" or "release" ordering.
  *
@@ -147,13 +137,6 @@
 int android_atomic_release_cas(int32_t oldvalue, int32_t newvalue,
         volatile int32_t* addr);
 
-#if defined (__LP64__)
-int64_t android_atomic_acquire_cas64(int64_t old_value, int64_t new_value,
-        volatile int64_t *ptr);
-int64_t android_atomic_release_cas64(int64_t old_value, int64_t new_value,
-        volatile int64_t *ptr);
-#endif
-
 /*
  * Aliases for code using an older version of this header.  These are now
  * deprecated and should not be used.  The definitions will be removed