From: VMware, Inc <> Date: Thu, 27 Oct 2011 18:46:16 +0000 (-0700) Subject: Changes in shared code that don't affect open-vm-tools functionality. X-Git-Tag: 2011.10.26-514583~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d3a42ae2a66d7e88f8984e4007a417abc2a2580b;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_defs.h b/open-vm-tools/lib/include/vm_basic_defs.h index ca5faeae8..e2c9d3ecb 100644 --- a/open-vm-tools/lib/include/vm_basic_defs.h +++ b/open-vm-tools/lib/include/vm_basic_defs.h @@ -160,6 +160,14 @@ Max(int a, int b) #define MASK(n) ((1 << (n)) - 1) /* make an n-bit mask */ #define MASK64(n) ((CONST64U(1) << (n)) - 1) /* make an n-bit mask */ +/* + * MASKRANGE64 makes a bit vector starting at bit lo and ending at bit hi. No + * checking for lo < hi is done. + */ +#define MASKRANGE64(hi, lo) (MASK64((hi) - (lo) + 1) << (lo)) + +/* SIGNEXT64 sign extends a value from bit position "pos" up to bit 63. */ +#define SIGNEXT64(val, pos) (((int64)(val) << (63 - (pos))) >> (63 - (pos))) #define DWORD_ALIGN(x) ((((x) + 3) >> 2) << 2) #define QWORD_ALIGN(x) ((((x) + 7) >> 3) << 3)