src/hotspot/os_cpu/linux_x86/orderAccess_linux_x86.hpp
changeset 55663 63d13c01f2b8
parent 54323 846bc643f4ef
child 59247 56bf71d64d51
equal deleted inserted replaced
55565:51b28beb53fd 55663:63d13c01f2b8
    55   compiler_barrier();
    55   compiler_barrier();
    56 }
    56 }
    57 
    57 
    58 inline void OrderAccess::cross_modify_fence() {
    58 inline void OrderAccess::cross_modify_fence() {
    59   int idx = 0;
    59   int idx = 0;
       
    60 #ifdef AMD64
    60   __asm__ volatile ("cpuid " : "+a" (idx) : : "ebx", "ecx", "edx", "memory");
    61   __asm__ volatile ("cpuid " : "+a" (idx) : : "ebx", "ecx", "edx", "memory");
       
    62 #else
       
    63   // On some x86 systems EBX is a reserved register that cannot be
       
    64   // clobbered, so we must protect it around the CPUID.
       
    65   __asm__ volatile ("xchg %%esi, %%ebx; cpuid; xchg %%esi, %%ebx " : "+a" (idx) : : "esi", "ecx", "edx", "memory");
       
    66 #endif
    61 }
    67 }
    62 
    68 
    63 template<>
    69 template<>
    64 struct OrderAccess::PlatformOrderedStore<1, RELEASE_X_FENCE>
    70 struct OrderAccess::PlatformOrderedStore<1, RELEASE_X_FENCE>
    65 {
    71 {