]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Change to shared header file unrelated to open-vm-tools.
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:36 +0000 (11:23 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:36 +0000 (11:23 -0700)
open-vm-tools/lib/include/vm_basic_math.h

index 6828ae0cebf3f031b2aad5351f8c6c5d804c1db0..0f7b559292affd31aeec5792852d2032e22fdcbd 100644 (file)
@@ -71,6 +71,7 @@ ExponentialAvg(uint32 avg, uint32 value, uint32 gainNumer, uint32 gainDenom)
  *-----------------------------------------------------------------------------
  *
  * IsZeroOrPowerOfTwo --
+ * IsZeroOrPowerOfTwo64 --
  *
  * Results:
  *      TRUE iff the value is 0 or a power of two.
@@ -81,6 +82,13 @@ ExponentialAvg(uint32 avg, uint32 value, uint32 gainNumer, uint32 gainDenom)
  *-----------------------------------------------------------------------------
  */
 
+static INLINE Bool
+IsZeroOrPowerOfTwo64(uint64 x)
+{
+   return !(x & (x - 1));
+}
+
+
 static INLINE Bool
 IsZeroOrPowerOfTwo(uint32 x)     // IN
 {