diff --git a/include/cutils/atomic-mips.h b/include/cutils/atomic-mips.h index f9d3e253e..1ed833de3 100644 --- a/include/cutils/atomic-mips.h +++ b/include/cutils/atomic-mips.h @@ -116,23 +116,6 @@ android_atomic_release_cas(int32_t old_value, } -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_swap(int32_t new_value, volatile int32_t *ptr) -{ - int32_t prev, status; - do { - __asm__ __volatile__ ( - " move %[status], %[new_value]\n" - " ll %[prev], (%[ptr])\n" - " sc %[status], (%[ptr])\n" - : [prev] "=&r" (prev), [status] "=&r" (status) - : [ptr] "r" (ptr), [new_value] "r" (new_value) - ); - } while (__builtin_expect(status == 0, 0)); - android_memory_barrier(); - return prev; -} - extern ANDROID_ATOMIC_INLINE int32_t android_atomic_add(int32_t increment, volatile int32_t *ptr) { diff --git a/include/cutils/atomic-mips64.h b/include/cutils/atomic-mips64.h index 382f2092d..99bbe3a55 100644 --- a/include/cutils/atomic-mips64.h +++ b/include/cutils/atomic-mips64.h @@ -168,23 +168,6 @@ int64_t android_atomic_release_cas64(int64_t old_value, int64_t new_value, return android_atomic_cas64(old_value, new_value, ptr); } -extern ANDROID_ATOMIC_INLINE -int32_t android_atomic_swap(int32_t new_value, volatile int32_t *ptr) -{ - int32_t prev, status; - do { - __asm__ __volatile__ ( - " move %[status], %[new_value]\n" - " ll %[prev], (%[ptr])\n" - " sc %[status], (%[ptr])\n" - : [prev] "=&r" (prev), [status] "=&r" (status) - : [ptr] "r" (ptr), [new_value] "r" (new_value) - ); - } while (__builtin_expect(status == 0, 0)); - android_memory_barrier(); - return prev; -} - extern ANDROID_ATOMIC_INLINE int32_t android_atomic_add(int32_t increment, volatile int32_t *ptr) {