From: VMware, Inc <> Date: Thu, 24 Feb 2011 21:28:58 +0000 (-0800) Subject: Changes in shared code that don't affect open-vm-tools functionality. X-Git-Tag: 2011.02.23-368700~68 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2e85dc9dee15f4134f53f434aed21e2015f04f56;p=thirdparty%2Fopen-vm-tools.git Changes in shared code that don't affect open-vm-tools functionality. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/include/vm_atomic.h b/open-vm-tools/lib/include/vm_atomic.h index dce1d1358..2614d1fcb 100644 --- a/open-vm-tools/lib/include/vm_atomic.h +++ b/open-vm-tools/lib/include/vm_atomic.h @@ -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__ /*