< prev index next >

src/os_cpu/bsd_x86/vm/atomic_bsd_x86.hpp

Print this page
rev 13266 : imported patch Atomic_refactoring
rev 13268 : [mq]: Atomic_polishing_v2


 123                         : "r" (exchange_value), "a" (compare_value), "r" (dest)
 124                         : "cc", "memory");
 125   return exchange_value;
 126 }
 127 
 128 #else // !AMD64
 129 
 130 extern "C" {
 131   // defined in bsd_x86.s
 132   int64_t _Atomic_cmpxchg_long(int64_t, volatile int64_t*, int64_t);
 133   void _Atomic_move_long(const volatile int64_t* src, volatile int64_t* dst);
 134 }
 135 
 136 template <>
 137 inline void Atomic::specialized_store<int64_t>(int64_t store_value, volatile int64_t* dest) {
 138   _Atomic_move_long(&store_value, dest);
 139 }
 140 
 141 template <>
 142 inline int64_t Atomic::specialized_load<int64_t>(const volatile int64_t* src) {
 143   volatile jlong dest;
 144   _Atomic_move_long(src, &dest);
 145   return dest;
 146 }
 147 
 148 template <>
 149 inline int64_t Atomic::specialized_cmpxchg<int64_t>(int64_t exchange_value, volatile int64_t* dest, int64_t compare_value, cmpxchg_memory_order order) {
 150   return _Atomic_cmpxchg_long(exchange_value, dest, compare_value);
 151 }
 152 
 153 #endif // AMD64
 154 
 155 #endif // OS_CPU_BSD_X86_VM_ATOMIC_BSD_X86_HPP


 123                         : "r" (exchange_value), "a" (compare_value), "r" (dest)
 124                         : "cc", "memory");
 125   return exchange_value;
 126 }
 127 
 128 #else // !AMD64
 129 
 130 extern "C" {
 131   // defined in bsd_x86.s
 132   int64_t _Atomic_cmpxchg_long(int64_t, volatile int64_t*, int64_t);
 133   void _Atomic_move_long(const volatile int64_t* src, volatile int64_t* dst);
 134 }
 135 
 136 template <>
 137 inline void Atomic::specialized_store<int64_t>(int64_t store_value, volatile int64_t* dest) {
 138   _Atomic_move_long(&store_value, dest);
 139 }
 140 
 141 template <>
 142 inline int64_t Atomic::specialized_load<int64_t>(const volatile int64_t* src) {
 143   volatile int64_t dest;
 144   _Atomic_move_long(src, &dest);
 145   return dest;
 146 }
 147 
 148 template <>
 149 inline int64_t Atomic::specialized_cmpxchg<int64_t>(int64_t exchange_value, volatile int64_t* dest, int64_t compare_value, cmpxchg_memory_order order) {
 150   return _Atomic_cmpxchg_long(exchange_value, dest, compare_value);
 151 }
 152 
 153 #endif // AMD64
 154 
 155 #endif // OS_CPU_BSD_X86_VM_ATOMIC_BSD_X86_HPP
< prev index next >