< prev index next >
src/os_cpu/linux_aarch64/vm/orderAccess_linux_aarch64.inline.hpp
Print this page
@@ -48,24 +48,69 @@
inline void OrderAccess::fence() {
FULL_MEM_BARRIER;
}
-template<size_t byte_size>
-struct OrderAccess::PlatformLoadAcquire<byte_size> {
+template<>
+struct OrderAccess::PlatformLoadAcquire<1> VALUE_OBJ_CLASS_SPEC {
template <typename T>
- T operator()(volatile T* p) const { T data; __atomic_load(p, &data, __ATOMIC_ACQUIRE); return data; }
+ T operator()(volatile T* p) const { T data = 0; __atomic_load(p, &data, __ATOMIC_ACQUIRE); return data; }
+};
+template<>
+struct OrderAccess::PlatformLoadAcquire<2> VALUE_OBJ_CLASS_SPEC {
+ template <typename T>
+ T operator()(volatile T* p) const { T data = 0; __atomic_load(p, &data, __ATOMIC_ACQUIRE); return data; }
+};
+template<>
+struct OrderAccess::PlatformLoadAcquire<4> VALUE_OBJ_CLASS_SPEC {
+ template <typename T>
+ T operator()(volatile T* p) const { T data = 0; __atomic_load(p, &data, __ATOMIC_ACQUIRE); return data; }
+};
+template<>
+struct OrderAccess::PlatformLoadAcquire<8> VALUE_OBJ_CLASS_SPEC {
+ template <typename T>
+ T operator()(volatile T* p) const { T data = 0; __atomic_load(p, &data, __ATOMIC_ACQUIRE); return data; }
};
-template<size_t byte_size>
-struct OrderAccess::PlatformReleaseStore<byte_size> {
+template<>
+struct OrderAccess::PlatformReleaseStore<1> VALUE_OBJ_CLASS_SPEC {
+ template <typename T>
+ void operator()(T v, volatile T* p) const { __atomic_store(p, &v, __ATOMIC_RELEASE); }
+};
+template<>
+struct OrderAccess::PlatformReleaseStore<2> VALUE_OBJ_CLASS_SPEC {
+ template <typename T>
+ void operator()(T v, volatile T* p) const { __atomic_store(p, &v, __ATOMIC_RELEASE); }
+};
+template<>
+struct OrderAccess::PlatformReleaseStore<4> VALUE_OBJ_CLASS_SPEC {
+ template <typename T>
+ void operator()(T v, volatile T* p) const { __atomic_store(p, &v, __ATOMIC_RELEASE); }
+};
+template<>
+struct OrderAccess::PlatformReleaseStore<8> VALUE_OBJ_CLASS_SPEC {
template <typename T>
void operator()(T v, volatile T* p) const { __atomic_store(p, &v, __ATOMIC_RELEASE); }
};
-template<size_t byte_size>
-struct OrderAccess::PlatformReleaseStoreFence<byte_size> {
+template<>
+struct OrderAccess::PlatformReleaseStoreFence<1> VALUE_OBJ_CLASS_SPEC {
+ template <typename T>
+ void operator()(T v, volatile T* p) const { release_store(p, v); fence(); }
+};
+template<>
+struct OrderAccess::PlatformReleaseStoreFence<2> VALUE_OBJ_CLASS_SPEC {
+ template <typename T>
+ void operator()(T v, volatile T* p) const { release_store(p, v); fence(); }
+};
+template<>
+struct OrderAccess::PlatformReleaseStoreFence<4> VALUE_OBJ_CLASS_SPEC {
+ template <typename T>
+ void operator()(T v, volatile T* p) const { release_store(p, v); fence(); }
+};
+template<>
+struct OrderAccess::PlatformReleaseStoreFence<8> VALUE_OBJ_CLASS_SPEC {
template <typename T>
void operator()(T v, volatile T* p) const { release_store(p, v); fence(); }
};
#endif // OS_CPU_LINUX_AARCH64_VM_ORDERACCESS_LINUX_AARCH64_INLINE_HPP
< prev index next >