From: John Wolfe Date: Mon, 19 Apr 2021 18:08:11 +0000 (-0700) Subject: Common header file change not applicable to open-vm-tools. X-Git-Tag: stable-11.3.0~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=865b31e49350e4aefa0858b6575051eae7def5e1;p=thirdparty%2Fopen-vm-tools.git Common header file change not applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/include/vm_atomic.h b/open-vm-tools/lib/include/vm_atomic.h index ae3708362..5e7bbe82a 100644 --- a/open-vm-tools/lib/include/vm_atomic.h +++ b/open-vm-tools/lib/include/vm_atomic.h @@ -2446,24 +2446,20 @@ static INLINE uint64 Atomic_ReadWrite64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { -#if defined __x86_64__ -#if defined __GNUC__ +#if defined __GNUC__ && defined __x86_64__ /* Checked against the AMD manual and GCC --hpreg */ __asm__ __volatile__( "xchgq %0, %1" : "=r" (val), - "+m" (var->value) + "+m" (var->value) : "0" (val) : "memory" ); return val; -#elif defined _MSC_VER - return _InterlockedExchange64((__int64 *)&var->value, (__int64)val); -#else -#error No compiler defined for Atomic_ReadWrite64 -#endif -#elif defined VM_ARM_64 +#elif defined __GNUC__ && defined VM_ARM_64 return _VMATOM_X(RW, 64, TRUE, &var->value, val); +#elif defined _MSC_VER && defined VM_64BIT + return _InterlockedExchange64((__int64 *)&var->value, (__int64)val); #else uint64 oldVal; @@ -2555,8 +2551,7 @@ static INLINE void Atomic_Or64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { -#if defined __x86_64__ -#if defined __GNUC__ +#if defined __GNUC__ && defined __x86_64__ /* Checked against the AMD manual and GCC --hpreg */ __asm__ __volatile__( "lock; orq %1, %0" @@ -2564,14 +2559,11 @@ Atomic_Or64(Atomic_uint64 *var, // IN/OUT : "re" (val) : "cc", "memory" ); -#elif defined _MSC_VER +#elif defined __GNUC__ && defined VM_ARM_64 + _VMATOM_X(OP, 64, TRUE, &var->value, orr, val); +#elif defined _MSC_VER && defined VM_64BIT _InterlockedOr64((__int64 *)&var->value, (__int64)val); #else -#error No compiler defined for Atomic_Or64 -#endif -#elif defined VM_ARM_64 - _VMATOM_X(OP, 64, TRUE, &var->value, orr, val); -#else // __x86_64__ uint64 oldVal; uint64 newVal; do { @@ -2602,8 +2594,7 @@ static INLINE void Atomic_And64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { -#if defined __x86_64__ -#if defined __GNUC__ +#if defined __GNUC__ && defined __x86_64__ /* Checked against the AMD manual and GCC --hpreg */ __asm__ __volatile__( "lock; andq %1, %0" @@ -2611,14 +2602,11 @@ Atomic_And64(Atomic_uint64 *var, // IN/OUT : "re" (val) : "cc", "memory" ); -#elif defined _MSC_VER +#elif defined __GNUC__ && defined VM_ARM_64 + _VMATOM_X(OP, 64, TRUE, &var->value, and, val); +#elif defined _MSC_VER && defined VM_64BIT _InterlockedAnd64((__int64 *)&var->value, (__int64)val); #else -#error No compiler defined for Atomic_And64 -#endif -#elif defined VM_ARM_64 - _VMATOM_X(OP, 64, TRUE, &var->value, and, val); -#else // __x86_64__ uint64 oldVal; uint64 newVal; do {