]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commit
vm_atomic.h: Implement Atomic_Bool operations on top of Atomic_uint8 operations
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:29 +0000 (11:23 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:29 +0000 (11:23 -0700)
commit3e732d788ef472bdf07dc53a32bc2c3b271a1ee5
tree51ef1a1bb9be04448b897b4323baaa6fb62c06ea
parent93efbb2335349fda6587cda662a389b8b99724b4
vm_atomic.h: Implement Atomic_Bool operations on top of Atomic_uint8 operations

The atomic code was inconsistent:
o On one hand we had Atomic_uint{16,32,64,128} basic types, on top of
  which we auto-generated more elaborate types such as Atomic_Ptr and
  Atomic_Int.
o On the other hand we had no Atomic_uint8, we had Atomic_Bool implemented
  as a basic type, and we had CMPXCHG1B (based on uint8, defined for
  vmkernel and vmm only, with an x86-specific name) that was implemented
  similarly to Atomic_ReadIfEqualWriteBool (based on Atomic_Bool, defined
  for everybody, with an architecture-neutral name).

This change brings a little bit of consistency:
o It defines Atomic_uint8 as a basic type.
o It auto-generates Atomic_Bool on top of it.
o It deletes CMPXCHG1B.

Also added a void * argument to AtomicUndefined(), which is used to
"consume" function parameters to prevent some compilers from warning
about unused parameters.
open-vm-tools/lib/include/vm_atomic.h