From: Kruti Pendharkar Date: Wed, 8 Jan 2025 06:05:49 +0000 (-0800) Subject: Change to common header file not applicable to open-vm-tools. X-Git-Tag: stable-13.0.0~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fef434d5893befa038a00a633e0084566aa528f9;p=thirdparty%2Fopen-vm-tools.git Change to common header file not applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/include/x86cpuid.h b/open-vm-tools/lib/include/x86cpuid.h index 5a6b4292a..62da3b761 100644 --- a/open-vm-tools/lib/include/x86cpuid.h +++ b/open-vm-tools/lib/include/x86cpuid.h @@ -2684,32 +2684,47 @@ CPUID_IsHypervisorLevel(uint32 level) return (level & 0xffffff00) == 0x40000000; } + /* *---------------------------------------------------------------------- * - * CPUID_LevelUsesEcx -- + * CPUID_LevelMaxRsvd -- * - * Returns TRUE for leaves that support input ECX != 0 (subleaves). + * Returns maximum number of reserved sub-leaves for a given CPUID leaf. * *---------------------------------------------------------------------- */ -static INLINE Bool -CPUID_LevelUsesEcx(uint32 level) { +static INLINE uint32 +CPUID_LevelMaxRsvd(uint32 level) { switch (level) { -#define CPUIDLEVEL(t, s, v, c, h) \ - case v: \ - return c != 0; +#define CPUIDLEVEL(t, s, v, c, h) \ + case v: \ + return c; CPUID_KNOWN_LEVELS #undef CPUIDLEVEL - - default: - return FALSE; } + return 0; +} + + +/* + *---------------------------------------------------------------------- + * + * CPUID_LevelUsesEcx -- + * + * Returns TRUE for leaves that support input ECX != 0 (subleaves). + * + *---------------------------------------------------------------------- + */ + +static INLINE Bool +CPUID_LevelUsesEcx(uint32 level) { + return CPUID_LevelMaxRsvd(level) != 0; } #ifdef _MSC_VER