]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Change to common header file not applicable to open-vm-tools.
authorKruti Pendharkar <kp025370@broadcom.com>
Wed, 8 Jan 2025 06:05:49 +0000 (22:05 -0800)
committerKruti Pendharkar <kp025370@broadcom.com>
Wed, 8 Jan 2025 06:05:49 +0000 (22:05 -0800)
open-vm-tools/lib/include/x86cpuid.h

index 5a6b4292ae5d75e4611158308014214bf61ec998..62da3b7612c89bba4c44224baf81c351fb48fd4f 100644 (file)
@@ -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