Home | History | Annotate | Download | only in libcutils

Lines Matching full:addr

45 #define  SWAP_LOCK(addr)   \
46 &_swap_locks[((unsigned)(void*)(addr) >> 3U) % SWAP_LOCK_COUNT]
49 void android_atomic_write(int32_t value, volatile int32_t* addr) {
52 oldValue = *addr;
53 } while (android_atomic_cmpxchg(oldValue, value, addr));
56 int32_t android_atomic_inc(volatile int32_t* addr) {
59 oldValue = *addr;
60 } while (android_atomic_cmpxchg(oldValue, oldValue+1, addr));
64 int32_t android_atomic_dec(volatile int32_t* addr) {
67 oldValue = *addr;
68 } while (android_atomic_cmpxchg(oldValue, oldValue-1, addr));
72 int32_t android_atomic_add(int32_t value, volatile int32_t* addr) {
75 oldValue = *addr;
76 } while (android_atomic_cmpxchg(oldValue, oldValue+value, addr));
80 int32_t android_atomic_and(int32_t value, volatile int32_t* addr) {
83 oldValue = *addr;
84 } while (android_atomic_cmpxchg(oldValue, oldValue&value, addr));
88 int32_t android_atomic_or(int32_t value, volatile int32_t* addr) {
91 oldValue = *addr;
92 } while (android_atomic_cmpxchg(oldValue, oldValue|value, addr));
96 int32_t android_atomic_swap(int32_t value, volatile int32_t* addr) {
99 oldValue = *addr;
100 } while (android_atomic_cmpxchg(oldValue, value, addr));
105 volatile int32_t* addr) {
107 pthread_mutex_t* lock = SWAP_LOCK(addr);
111 if (*addr == oldvalue) {
112 *addr = newvalue;
121 int64_t android_quasiatomic_swap_64(int64_t value, volatile int64_t* addr) {
123 pthread_mutex_t* lock = SWAP_LOCK(addr);
127 oldValue = *addr;
128 *addr = value;
135 volatile int64_t* addr) {
137 pthread_mutex_t* lock = SWAP_LOCK(addr);
141 if (*addr == oldvalue) {
142 *addr = newvalue;
151 int64_t android_quasiatomic_read_64(volatile int64_t* addr) {
153 pthread_mutex_t* lock = SWAP_LOCK(addr);
156 result = *addr;