From: VMware, Inc <> Date: Mon, 21 Nov 2011 23:00:28 +0000 (-0800) Subject: Changes in shared code that don't affect open-vm-tools functionality. X-Git-Tag: 2011.11.20-535097~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65bb7578fbe71045fff7f4319e65e0140a05baf1;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_basic_asm.h b/open-vm-tools/lib/include/vm_basic_asm.h index 69383c6b3..b47c94d2f 100644 --- a/open-vm-tools/lib/include/vm_basic_asm.h +++ b/open-vm-tools/lib/include/vm_basic_asm.h @@ -1028,9 +1028,10 @@ ClearBit64(uint64 *var, uint64 index) _bittestandreset64((__int64 *)var, index); #endif } +#endif /* VM_X86_64 */ static INLINE Bool -TestBit32(uint32 *var, uint32 index) +TestBit32(const uint32 *var, uint32 index) { #ifdef __GNUC__ Bool bit; @@ -1042,15 +1043,15 @@ TestBit32(uint32 *var, uint32 index) : "cc" ); return bit; -#elif defined _MSC_VER +#else return (*var & (1 << index)) != 0; #endif } static INLINE Bool -TestBit64(uint64 *var, uint64 index) +TestBit64(const uint64 *var, uint64 index) { -#ifdef __GNUC__ +#if defined __GNUC__ && defined VM_X86_64 Bool bit; __asm__ ( "bt %[index], %[var] \n" @@ -1060,11 +1061,10 @@ TestBit64(uint64 *var, uint64 index) : "cc" ); return bit; -#elif defined _MSC_VER +#else return (*var & (CONST64U(1) << index)) != 0; #endif } -#endif /* VM_X86_64 */ /* *-----------------------------------------------------------------------------