hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp
changeset 39404 d0ad5220e91c
parent 25715 d5a8dbdc5150
child 40655 9f644073d3a0
equal deleted inserted replaced
39403:37f78de0f227 39404:d0ad5220e91c
   146 inline void*    Atomic::xchg_ptr(void*    exchange_value, volatile void*     dest) {
   146 inline void*    Atomic::xchg_ptr(void*    exchange_value, volatile void*     dest) {
   147   return (void*)xchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest);
   147   return (void*)xchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest);
   148 }
   148 }
   149 
   149 
   150 
   150 
   151 inline jint     Atomic::cmpxchg    (jint     exchange_value, volatile jint*     dest, jint     compare_value) {
   151 inline jint     Atomic::cmpxchg    (jint     exchange_value, volatile jint*     dest, jint     compare_value, cmpxchg_memory_order order) {
   152   jint rv;
   152   jint rv;
   153   __asm__ volatile(
   153   __asm__ volatile(
   154     " cas    [%2], %3, %0"
   154     " cas    [%2], %3, %0"
   155     : "=r" (rv)
   155     : "=r" (rv)
   156     : "0" (exchange_value), "r" (dest), "r" (compare_value)
   156     : "0" (exchange_value), "r" (dest), "r" (compare_value)
   157     : "memory");
   157     : "memory");
   158   return rv;
   158   return rv;
   159 }
   159 }
   160 
   160 
   161 inline jlong    Atomic::cmpxchg    (jlong    exchange_value, volatile jlong*    dest, jlong    compare_value) {
   161 inline jlong    Atomic::cmpxchg    (jlong    exchange_value, volatile jlong*    dest, jlong    compare_value, cmpxchg_memory_order order) {
   162 #ifdef _LP64
   162 #ifdef _LP64
   163   jlong rv;
   163   jlong rv;
   164   __asm__ volatile(
   164   __asm__ volatile(
   165     " casx   [%2], %3, %0"
   165     " casx   [%2], %3, %0"
   166     : "=r" (rv)
   166     : "=r" (rv)
   188 
   188 
   189   return rv.long_value;
   189   return rv.long_value;
   190 #endif
   190 #endif
   191 }
   191 }
   192 
   192 
   193 inline intptr_t Atomic::cmpxchg_ptr(intptr_t exchange_value, volatile intptr_t* dest, intptr_t compare_value) {
   193 inline intptr_t Atomic::cmpxchg_ptr(intptr_t exchange_value, volatile intptr_t* dest, intptr_t compare_value, cmpxchg_memory_order order) {
   194   intptr_t rv;
   194   intptr_t rv;
   195 #ifdef _LP64
   195 #ifdef _LP64
   196   __asm__ volatile(
   196   __asm__ volatile(
   197     " casx    [%2], %3, %0"
   197     " casx    [%2], %3, %0"
   198     : "=r" (rv)
   198     : "=r" (rv)
   206     : "memory");
   206     : "memory");
   207 #endif // _LP64
   207 #endif // _LP64
   208   return rv;
   208   return rv;
   209 }
   209 }
   210 
   210 
   211 inline void*    Atomic::cmpxchg_ptr(void*    exchange_value, volatile void*     dest, void*    compare_value) {
   211 inline void*    Atomic::cmpxchg_ptr(void*    exchange_value, volatile void*     dest, void*    compare_value, cmpxchg_memory_order order) {
   212   return (void*)cmpxchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest, (intptr_t)compare_value);
   212   return (void*)cmpxchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest, (intptr_t)compare_value, order);
   213 }
   213 }
   214 
   214 
   215 #endif // OS_CPU_LINUX_SPARC_VM_ATOMIC_LINUX_SPARC_INLINE_HPP
   215 #endif // OS_CPU_LINUX_SPARC_VM_ATOMIC_LINUX_SPARC_INLINE_HPP