src/hotspot/os_cpu/linux_ppc/orderAccess_linux_ppc.hpp
changeset 59247 56bf71d64d51
parent 54323 846bc643f4ef
equal deleted inserted replaced
59246:fcad92f425c5 59247:56bf71d64d51
    66 
    66 
    67 #define inlasm_sync()     __asm__ __volatile__ ("sync"   : : : "memory");
    67 #define inlasm_sync()     __asm__ __volatile__ ("sync"   : : : "memory");
    68 #define inlasm_lwsync()   __asm__ __volatile__ ("lwsync" : : : "memory");
    68 #define inlasm_lwsync()   __asm__ __volatile__ ("lwsync" : : : "memory");
    69 #define inlasm_eieio()    __asm__ __volatile__ ("eieio"  : : : "memory");
    69 #define inlasm_eieio()    __asm__ __volatile__ ("eieio"  : : : "memory");
    70 #define inlasm_isync()    __asm__ __volatile__ ("isync"  : : : "memory");
    70 #define inlasm_isync()    __asm__ __volatile__ ("isync"  : : : "memory");
    71 // Use twi-isync for load_acquire (faster than lwsync).
       
    72 #define inlasm_acquire_reg(X) __asm__ __volatile__ ("twi 0,%0,0\n isync\n" : : "r" (X) : "memory");
       
    73 
    71 
    74 inline void   OrderAccess::loadload()   { inlasm_lwsync(); }
    72 inline void   OrderAccess::loadload()   { inlasm_lwsync(); }
    75 inline void   OrderAccess::storestore() { inlasm_lwsync(); }
    73 inline void   OrderAccess::storestore() { inlasm_lwsync(); }
    76 inline void   OrderAccess::loadstore()  { inlasm_lwsync(); }
    74 inline void   OrderAccess::loadstore()  { inlasm_lwsync(); }
    77 inline void   OrderAccess::storeload()  { inlasm_sync();   }
    75 inline void   OrderAccess::storeload()  { inlasm_sync();   }
    80 inline void   OrderAccess::release()    { inlasm_lwsync(); }
    78 inline void   OrderAccess::release()    { inlasm_lwsync(); }
    81 inline void   OrderAccess::fence()      { inlasm_sync();   }
    79 inline void   OrderAccess::fence()      { inlasm_sync();   }
    82 inline void   OrderAccess::cross_modify_fence()
    80 inline void   OrderAccess::cross_modify_fence()
    83                                         { inlasm_isync();  }
    81                                         { inlasm_isync();  }
    84 
    82 
    85 template<size_t byte_size>
       
    86 struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
       
    87 {
       
    88   template <typename T>
       
    89   T operator()(const volatile T* p) const { T t = Atomic::load(p); inlasm_acquire_reg(t); return t; }
       
    90 };
       
    91 
       
    92 #undef inlasm_sync
    83 #undef inlasm_sync
    93 #undef inlasm_lwsync
    84 #undef inlasm_lwsync
    94 #undef inlasm_eieio
    85 #undef inlasm_eieio
    95 #undef inlasm_isync
    86 #undef inlasm_isync
    96 #undef inlasm_acquire_reg
       
    97 
    87 
    98 #endif // OS_CPU_LINUX_PPC_ORDERACCESS_LINUX_PPC_HPP
    88 #endif // OS_CPU_LINUX_PPC_ORDERACCESS_LINUX_PPC_HPP