src/hotspot/os_cpu/linux_ppc/atomic_linux_ppc.hpp
changeset 59247 56bf71d64d51
parent 54069 c4fb912f3085
child 59249 29b0d0b61615
equal deleted inserted replaced
59246:fcad92f425c5 59247:56bf71d64d51
    28 
    28 
    29 #ifndef PPC64
    29 #ifndef PPC64
    30 #error "Atomic currently only implemented for PPC64"
    30 #error "Atomic currently only implemented for PPC64"
    31 #endif
    31 #endif
    32 
    32 
       
    33 #include "orderAccess_linux_ppc.hpp"
    33 #include "utilities/debug.hpp"
    34 #include "utilities/debug.hpp"
    34 
    35 
    35 // Implementation of class atomic
    36 // Implementation of class atomic
    36 
    37 
    37 //
    38 //
   397   post_membar(order);
   398   post_membar(order);
   398 
   399 
   399   return old_value;
   400   return old_value;
   400 }
   401 }
   401 
   402 
       
   403 template<size_t byte_size>
       
   404 struct Atomic::PlatformOrderedLoad<byte_size, X_ACQUIRE>
       
   405 {
       
   406   template <typename T>
       
   407   T operator()(const volatile T* p) const {
       
   408     T t = Atomic::load(p);
       
   409     // Use twi-isync for load_acquire (faster than lwsync).
       
   410     __asm__ __volatile__ ("twi 0,%0,0\n isync\n" : : "r" (t) : "memory");
       
   411     return t;
       
   412   }
       
   413 };
       
   414 
   402 #endif // OS_CPU_LINUX_PPC_ATOMIC_LINUX_PPC_HPP
   415 #endif // OS_CPU_LINUX_PPC_ATOMIC_LINUX_PPC_HPP