Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41e0d9a8 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "libcutils: Reintroduce the android_atomic_cmpxchg symbol on ARM" into gingerbread

parents 06b66140 55daeabb
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -129,6 +129,15 @@ extern inline int android_atomic_release_cas(int32_t old_value,
    return android_atomic_cas(old_value, new_value, ptr);
}

/* Yeah, deprecated but old props use it */
extern inline int android_atomic_cmpxchg(int32_t old_value,
                                             int32_t new_value,
                                             volatile int32_t *ptr)
{
    android_memory_barrier();
    return android_atomic_cas(old_value, new_value, ptr);
}


#if defined(__thumb__)
extern int32_t android_atomic_swap(int32_t new_value,
+6 −1
Original line number Diff line number Diff line
@@ -112,6 +112,12 @@ int android_atomic_acquire_cas(int32_t oldvalue, int32_t newvalue,
        volatile int32_t* addr);
int android_atomic_release_cas(int32_t oldvalue, int32_t newvalue,
        volatile int32_t* addr);
#if defined(__ARM_ARCH__) || defined (__ARM_EABI__)
int android_atomic_cmpxchg(int32_t oldvalue, int32_t newvalue,
        volatile int32_t* addr);
#else
#define android_atomic_cmpxchg android_atomic_release_cas
#endif

/*
 * Aliases for code using an older version of this header.  These are now
@@ -119,7 +125,6 @@ int android_atomic_release_cas(int32_t oldvalue, int32_t newvalue,
 * in a future release.
 */
#define android_atomic_write android_atomic_release_store
#define android_atomic_cmpxchg android_atomic_release_cas

#ifdef __cplusplus
} // extern "C"