< prev index next >

src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp

Print this page




 152    contents of `*PTR'.  */
 153 static inline int arm_lock_test_and_set(volatile int *ptr, int newval) {
 154   for (;;) {
 155       // Loop until a __kernel_cmpxchg succeeds.
 156       int prev = *ptr;
 157 
 158       if (__kernel_cmpxchg (prev, newval, ptr) == 0)
 159         return prev;
 160     }
 161 }
 162 #endif // ARM
 163 
 164 inline void Atomic::store(jint store_value, volatile jint* dest) {
 165   *dest = store_value;
 166 }
 167 
 168 inline void Atomic::store_ptr(intptr_t store_value, intptr_t* dest) {
 169   *dest = store_value;
 170 }
 171 




 172 inline jint Atomic::add(jint add_value, volatile jint* dest) {
 173 #ifdef ARM
 174   return arm_add_and_fetch(dest, add_value);
 175 #else
 176 #ifdef M68K
 177   return m68k_add_and_fetch(dest, add_value);
 178 #else
 179   return __sync_add_and_fetch(dest, add_value);
 180 #endif // M68K
 181 #endif // ARM
 182 }
 183 
 184 inline intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest) {
 185 #ifdef ARM
 186   return arm_add_and_fetch(dest, add_value);
 187 #else
 188 #ifdef M68K
 189   return m68k_add_and_fetch(dest, add_value);
 190 #else
 191   return __sync_add_and_fetch(dest, add_value);




 152    contents of `*PTR'.  */
 153 static inline int arm_lock_test_and_set(volatile int *ptr, int newval) {
 154   for (;;) {
 155       // Loop until a __kernel_cmpxchg succeeds.
 156       int prev = *ptr;
 157 
 158       if (__kernel_cmpxchg (prev, newval, ptr) == 0)
 159         return prev;
 160     }
 161 }
 162 #endif // ARM
 163 
 164 inline void Atomic::store(jint store_value, volatile jint* dest) {
 165   *dest = store_value;
 166 }
 167 
 168 inline void Atomic::store_ptr(intptr_t store_value, intptr_t* dest) {
 169   *dest = store_value;
 170 }
 171 
 172 inline void Atomic::store_ptr(intptr_t store_value, volatile intptr_t* dest) {
 173   *dest = store_value;
 174 }
 175 
 176 inline jint Atomic::add(jint add_value, volatile jint* dest) {
 177 #ifdef ARM
 178   return arm_add_and_fetch(dest, add_value);
 179 #else
 180 #ifdef M68K
 181   return m68k_add_and_fetch(dest, add_value);
 182 #else
 183   return __sync_add_and_fetch(dest, add_value);
 184 #endif // M68K
 185 #endif // ARM
 186 }
 187 
 188 inline intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest) {
 189 #ifdef ARM
 190   return arm_add_and_fetch(dest, add_value);
 191 #else
 192 #ifdef M68K
 193   return m68k_add_and_fetch(dest, add_value);
 194 #else
 195   return __sync_add_and_fetch(dest, add_value);


< prev index next >