From: John Wolfe Date: Mon, 9 Nov 2020 20:29:03 +0000 (-0800) Subject: Changes to common header files not applicable to open-vm-tools. X-Git-Tag: stable-11.3.0~266 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f7df88d6bd7d3621a241cb0267b6523d28f9311;p=thirdparty%2Fopen-vm-tools.git Changes to common header files not applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/include/vm_assert.h b/open-vm-tools/lib/include/vm_assert.h index ddcf673c3..1c8d0590e 100644 --- a/open-vm-tools/lib/include/vm_assert.h +++ b/open-vm-tools/lib/include/vm_assert.h @@ -80,6 +80,7 @@ // XXX not necessary except some places include vm_assert.h improperly #include "vm_basic_types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/open-vm-tools/lib/include/vm_basic_defs.h b/open-vm-tools/lib/include/vm_basic_defs.h index cea89a144..980f1ff32 100644 --- a/open-vm-tools/lib/include/vm_basic_defs.h +++ b/open-vm-tools/lib/include/vm_basic_defs.h @@ -169,6 +169,15 @@ Max(int a, int b) #define ROUNDUPBITS(x, bits) (((uintptr_t) (x) + MASK(bits)) & ~MASK(bits)) #define ROUNDDOWNBITS(x, bits) ((uintptr_t) (x) & ~MASK(bits)) #define CEILING(x, y) (((x) + (y) - 1) / (y)) + +#if defined VMKERNEL || defined VMKBOOT +# define CEIL(_a, _b) CEILING(_a, _b) +# define FLOOR(_a, _b) ((_a)/(_b)) +# define ALIGN_DOWN(_a, _b) ROUNDDOWN(_a, _b) +# define ALIGN_UP(_a, _b) ROUNDUP(_a, _b) +# define IS_ALIGNED(_a, _b) (ALIGN_DOWN(_a, _b) == _a) +#endif + #if defined __APPLE__ #include #undef MASK