]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Common header file change not applicable to open-vm-tools.
authorJohn Wolfe <jwolfe@vmware.com>
Thu, 7 Oct 2021 06:40:31 +0000 (23:40 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Thu, 7 Oct 2021 06:40:31 +0000 (23:40 -0700)
open-vm-tools/lib/include/vm_basic_asm.h

index f9520a3b29aa3fab4c1bbe610249cc4c4c70f9be..1b9ae7c9aef53e69960d8e45a3721342fcdc42ec 100644 (file)
@@ -844,9 +844,10 @@ RDTSC(void)
 /*
  *-----------------------------------------------------------------------------
  *
- * {Clear,Set,Test}Bit{32,64} --
+ * {Clear, Set, Test, Toggle}Bit{32, 64} --
  *
- *    Sets tests or clears a specified single bit in the provided variable.
+ *    Sets tests clears or toggles a specified single bit in the provided
+ *    variable.
  *
  *    The index input value specifies which bit to modify and is 0-based.
  *    Index is truncated by hardware to a 5-bit or 6-bit offset for the
@@ -871,6 +872,12 @@ ClearBit32(uint32 *var, unsigned index)
    *var &= ~(1 << index);
 }
 
+static INLINE void
+ToggleBit32(uint32 *var, unsigned index)
+{
+   *var ^= 1 << index;
+}
+
 static INLINE void
 SetBit64(uint64 *var, unsigned index)
 {
@@ -883,6 +890,12 @@ ClearBit64(uint64 *var, unsigned index)
    *var &= ~(CONST64U(1) << index);
 }
 
+static INLINE void
+ToggleBit64(uint64 *var, unsigned index)
+{
+   *var ^= (CONST64U(1) << index);
+}
+
 static INLINE Bool
 TestBit32(const uint32 *var, unsigned index)
 {