From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:36 +0000 (-0700) Subject: Check alignment in Atomic_* functions for the VMKernel X-Git-Tag: stable-10.2.0~246 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94702b2a09cdbad725f6e536203c4bab1bdcf9c0;p=thirdparty%2Fopen-vm-tools.git Check alignment in Atomic_* functions for the VMKernel Unrelated to open-vm-tools. --- diff --git a/open-vm-tools/lib/include/vm_atomic.h b/open-vm-tools/lib/include/vm_atomic.h index bca9053c6..326e99cb7 100644 --- a/open-vm-tools/lib/include/vm_atomic.h +++ b/open-vm-tools/lib/include/vm_atomic.h @@ -912,7 +912,7 @@ Atomic_Read32(Atomic_uint32 const *var) // IN { uint32 value; -#if defined VMM || defined VM_ARM_64 +#if defined VMM || defined VM_ARM_64 || defined VMKERNEL || defined VMKERNEL_MODULE ASSERT(((uintptr_t)var % 4) == 0); #endif @@ -1048,7 +1048,7 @@ static INLINE void Atomic_Write32(Atomic_uint32 *var, // OUT uint32 val) // IN { -#if defined VMM || defined VM_ARM_64 +#if defined VMM || defined VM_ARM_64 || defined VMKERNEL || defined VMKERNEL_MODULE ASSERT(((uintptr_t)var % 4) == 0); #endif @@ -2260,7 +2260,7 @@ Atomic_Read64(Atomic_uint64 const *var) // IN uint64 value; #endif -#if defined VMM || defined VM_ARM_64 +#if defined VMM || defined VM_ARM_64 || defined VMKERNEL || defined VMKERNEL_MODULE ASSERT((uintptr_t)var % 8 == 0); #endif @@ -2717,7 +2717,7 @@ static INLINE void Atomic_Write64(Atomic_uint64 *var, // OUT uint64 val) // IN { -#if defined VMM || defined VM_ARM_64 +#if defined VMM || defined VM_ARM_64 || defined VMKERNEL || defined VMKERNEL_MODULE ASSERT((uintptr_t)var % 8 == 0); #endif @@ -3021,7 +3021,7 @@ Atomic_Read16(Atomic_uint16 const *var) // IN { uint16 value; -#if defined VMM || defined VM_ARM_64 +#if defined VMM || defined VM_ARM_64 || defined VMKERNEL || defined VMKERNEL_MODULE ASSERT((uintptr_t)var % 2 == 0); #endif @@ -3131,7 +3131,7 @@ static INLINE void Atomic_Write16(Atomic_uint16 *var, // OUT: uint16 val) // IN: { -#if defined VMM || defined VM_ARM_64 +#if defined VMM || defined VM_ARM_64 || defined VMKERNEL || defined VMKERNEL_MODULE ASSERT((uintptr_t)var % 2 == 0); #endif