]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes in shared code that don't affect open-vm-tools functionality.
authorVMware, Inc <>
Thu, 24 Feb 2011 21:28:58 +0000 (13:28 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 24 Feb 2011 21:28:58 +0000 (13:28 -0800)
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/include/vm_atomic.h

index dce1d13586af7cd19cb5ae68d752c56dad493b2d..2614d1fcbd8ae8654f783c894cf54ea1dab540b1 100644 (file)
@@ -1163,7 +1163,37 @@ Atomic_ReadOr64(Atomic_uint64 *var, // IN
 
    return res;
 }
-#endif
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * Atomic_ReadAnd64 --
+ *
+ *      Atomic read (returned), bitwise AND with a value, write.
+ *
+ * Results:
+ *      The value of the variable before the operation.
+ *
+ * Side effects:
+ *      None
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+static INLINE uint64
+Atomic_ReadAnd64(Atomic_uint64 *var, // IN
+                 uint64 val)         // IN
+{
+   uint64 res;
+
+   do {
+      res = var->value;
+   } while (res != Atomic_ReadIfEqualWrite64(var, res, res & val));
+
+   return res;
+}
+#endif // __x86_64__
 
 
 /*