From: John Wolfe Date: Thu, 7 Oct 2021 06:40:31 +0000 (-0700) Subject: Common header file change not applicable to open-vm-tools. X-Git-Tag: stable-12.0.0~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4aecc2978e09dddc1f7a0c9af7e9b8ffa57227e2;p=thirdparty%2Fopen-vm-tools.git Common header file change not applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/include/vm_basic_asm.h b/open-vm-tools/lib/include/vm_basic_asm.h index f9520a3b2..1b9ae7c9a 100644 --- a/open-vm-tools/lib/include/vm_basic_asm.h +++ b/open-vm-tools/lib/include/vm_basic_asm.h @@ -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) {