summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorCarl Shapiro <cshapiro@google.com>2011-01-24 16:46:45 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-01-24 16:46:45 -0800
commitf59ed65c47576435a0438263b3832bb19e2eb8d2 (patch)
treefdd6cbd9ea1a562f1b91ae86773f05dcfb2171c9 /include
parent1aa59a83b57154d7b28f92e28d41ba497d639895 (diff)
parent3b093369d85f2d248799073152ece79987d4b30b (diff)
downloadsystem_core-f59ed65c47576435a0438263b3832bb19e2eb8d2.zip
system_core-f59ed65c47576435a0438263b3832bb19e2eb8d2.tar.gz
system_core-f59ed65c47576435a0438263b3832bb19e2eb8d2.tar.bz2
am 3b093369: am 1147407b: Merge "Remove unconditional swap from the android atomic operations suite." into honeycomb
* commit '3b093369d85f2d248799073152ece79987d4b30b': Remove unconditional swap from the android atomic operations suite.
Diffstat (limited to 'include')
-rw-r--r--include/cutils/atomic-arm.h32
-rw-r--r--include/cutils/atomic-x86.h11
-rw-r--r--include/cutils/atomic.h7
3 files changed, 0 insertions, 50 deletions
diff --git a/include/cutils/atomic-arm.h b/include/cutils/atomic-arm.h
index 004cc0c..16fe512 100644
--- a/include/cutils/atomic-arm.h
+++ b/include/cutils/atomic-arm.h
@@ -146,38 +146,6 @@ extern inline int android_atomic_release_cas(int32_t old_value,
#if defined(__thumb__)
-extern int32_t android_atomic_swap(int32_t new_value,
- volatile int32_t *ptr);
-#elif defined(__ARM_HAVE_LDREX_STREX)
-extern inline int32_t android_atomic_swap(int32_t new_value,
- volatile int32_t *ptr)
-{
- int32_t prev, status;
- do {
- __asm__ __volatile__ ("ldrex %0, [%3]\n"
- "strex %1, %4, [%3]"
- : "=&r" (prev), "=&r" (status), "+m" (*ptr)
- : "r" (ptr), "r" (new_value)
- : "cc");
- } while (__builtin_expect(status != 0, 0));
- android_memory_barrier();
- return prev;
-}
-#else
-extern inline int32_t android_atomic_swap(int32_t new_value,
- volatile int32_t *ptr)
-{
- int32_t prev;
- __asm__ __volatile__ ("swp %0, %2, [%3]"
- : "=&r" (prev), "+m" (*ptr)
- : "r" (new_value), "r" (ptr)
- : "cc");
- android_memory_barrier();
- return prev;
-}
-#endif
-
-#if defined(__thumb__)
extern int32_t android_atomic_add(int32_t increment,
volatile int32_t *ptr);
#elif defined(__ARM_HAVE_LDREX_STREX)
diff --git a/include/cutils/atomic-x86.h b/include/cutils/atomic-x86.h
index bce23ad..438012e 100644
--- a/include/cutils/atomic-x86.h
+++ b/include/cutils/atomic-x86.h
@@ -98,17 +98,6 @@ extern inline int android_atomic_release_cas(int32_t old_value,
return android_atomic_cas(old_value, new_value, ptr);
}
-extern inline int32_t android_atomic_swap(int32_t new_value,
- volatile int32_t *ptr)
-{
- __asm__ __volatile__ ("xchgl %1, %0"
- : "=r" (new_value)
- : "m" (*ptr), "0" (new_value)
- : "memory");
- /* new_value now holds the old value of *ptr */
- return new_value;
-}
-
extern inline int32_t android_atomic_add(int32_t increment,
volatile int32_t *ptr)
{
diff --git a/include/cutils/atomic.h b/include/cutils/atomic.h
index a50bf0f..ae42eb8 100644
--- a/include/cutils/atomic.h
+++ b/include/cutils/atomic.h
@@ -90,13 +90,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);
/*
- * Unconditional swap operation with release ordering.
- *
- * Stores the new value at *addr, and returns the previous value.
- */
-int32_t android_atomic_swap(int32_t value, volatile int32_t* addr);
-
-/*
* Compare-and-set operation with "acquire" or "release" ordering.
*
* This returns zero if the new value was successfully stored, which will