]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Change to common header file not applicable to open-vm-tools.
authorKaty Feng <fkaty@vmware.com>
Tue, 21 Nov 2023 20:17:25 +0000 (12:17 -0800)
committerKaty Feng <fkaty@vmware.com>
Tue, 21 Nov 2023 20:17:25 +0000 (12:17 -0800)
open-vm-tools/lib/include/vm_basic_asm.h

index 9d98b869c54587be21cbbe150d6f9673145f045e..c259c53cf531d41358750cd9f322190fbff130c4 100644 (file)
@@ -678,11 +678,20 @@ Bswap32(uint32 v) // IN
 static INLINE uint64
 Bswap64(uint64 v) // IN
 {
-#if defined(VM_ARM_64) && !defined(_MSC_VER)
+#if defined _MSC_VER
+   return _byteswap_uint64(v);
+#elif defined __GNUC__
+
+/* TODO: Return __builtin_bswap64(v) if gcc-arm64 is verified to use "rev". */
+#if defined VM_ARM_64
    __asm__("rev %0, %0" : "+r"(v));
    return v;
 #else
-   return ((uint64)Bswap((uint32)v) << 32) | Bswap((uint32)(v >> 32));
+   return __builtin_bswap64(v);
+#endif
+
+#else
+   return ((uint64)Bswap32((uint32)v) << 32) | Bswap32((uint32)(v >> 32));
 #endif
 }