]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes to common header files not applicable to open-vm-tools.
authorOliver Kurth <okurth@vmware.com>
Thu, 8 Feb 2018 00:39:26 +0000 (16:39 -0800)
committerOliver Kurth <okurth@vmware.com>
Thu, 8 Feb 2018 00:39:26 +0000 (16:39 -0800)
open-vm-tools/lib/include/x86cpuid.h
open-vm-tools/lib/include/x86vendor.h

index fdff5b9abeebd6e930f9b159545312cbe4536e55..efd6229c5551da304504be174dcab1ad033c9f56 100644 (file)
@@ -225,6 +225,7 @@ typedef enum {
 #define CPUID_AMD_VENDOR_STRING         "AuthcAMDenti"
 #define CPUID_CYRIX_VENDOR_STRING       "CyriteadxIns"
 #define CPUID_VIA_VENDOR_STRING         "CentaulsaurH"
+#define CPUID_HIGON_VENDOR_STRING       "HygouinenGen"
 
 #define CPUID_HYPERV_HYPERVISOR_VENDOR_STRING  "Microsoft Hv"
 #define CPUID_KVM_HYPERVISOR_VENDOR_STRING     "KVMKVMKVM\0\0\0"
@@ -235,6 +236,7 @@ typedef enum {
 #define CPUID_AMD_VENDOR_STRING_FIXED   "AuthenticAMD"
 #define CPUID_CYRIX_VENDOR_STRING_FIXED "CyrixInstead"
 #define CPUID_VIA_VENDOR_STRING_FIXED   "CentaurHauls"
+#define CPUID_HIGON_VENDOR_STRING_FIXED "GenuineHygon"
 
 /*
  * FIELD can be defined to process the CPUID information provided in the
@@ -1362,6 +1364,9 @@ CPUIDCheck(int32 eaxIn, int32 eaxInCheck,
 /* Effective VIA CPU Families */
 #define CPUID_FAMILY_C7               6
 
+/* Effective Higon CPU Families */
+#define CPUID_FAMILY_DHYANA           1
+
 /* Intel model information */
 #define CPUID_MODEL_PPRO              1
 #define CPUID_MODEL_PII_03            3
@@ -1442,17 +1447,21 @@ CPUIDCheck(int32 eaxIn, int32 eaxInCheck,
 #define CPUID_MODEL_ZEN_1F            0x1F // Max Zen model defined in BKDG
 
 /* VIA model information */
-#define CPUID_MODEL_NANO       15     // Isaiah
+#define CPUID_MODEL_NANO                15 // Isaiah
+
+/* Higon model information */
+#define CPUID_MODEL_DHYANA_A0            0 // Dhyana A0
 
 /*
  *----------------------------------------------------------------------
  *
- * CPUID_IsVendor{AMD,Intel,VIA} --
+ * CPUID_IsVendor{AMD,Intel,VIA,Higon} --
  *
- *      Determines if the vendor string in cpuid id0 is from {AMD,Intel,VIA}.
+ *      Determines if the vendor string in cpuid id0 is from
+ *      {AMD,Intel,VIA,Higon}.
  *
  * Results:
- *      True iff vendor string is CPUID_{AMD,INTEL,VIA}_VENDOR_STRING
+ *      True iff vendor string is CPUID_{AMD,INTEL,VIA,HIGON}_VENDOR_STRING
  *
  * Side effects:
  *      None.
@@ -1486,6 +1495,12 @@ CPUID_IsVendorVIA(CPUIDRegs *id0)
    return CPUID_IsRawVendor(id0, CPUID_VIA_VENDOR_STRING);
 }
 
+static INLINE Bool
+CPUID_IsVendorHigon(CPUIDRegs *id0)
+{
+   return CPUID_IsRawVendor(id0, CPUID_HIGON_VENDOR_STRING);
+}
+
 static INLINE uint32
 CPUID_EFFECTIVE_FAMILY(uint32 v) /* %eax from CPUID with %eax=1. */
 {
@@ -1966,6 +1981,22 @@ CPUID_MODEL_IS_ZEN(uint32 eax)
           CPUID_EFFECTIVE_MODEL(eax) <= CPUID_MODEL_ZEN_1F;
 }
 
+
+static INLINE Bool
+CPUID_FAMILY_IS_DHYANA(uint32 eax)
+{
+   return CPUID_EFFECTIVE_FAMILY(eax) == CPUID_FAMILY_DHYANA;
+}
+
+
+static INLINE Bool
+CPUID_MODEL_IS_DHYANA_A0(uint32 eax)
+{
+   return CPUID_EFFECTIVE_FAMILY(eax) == CPUID_FAMILY_DHYANA &&
+          CPUID_EFFECTIVE_MODEL(eax)  == CPUID_MODEL_DHYANA_A0;
+}
+
+
 #define CPUID_TYPE_PRIMARY     0
 #define CPUID_TYPE_OVERDRIVE   1
 #define CPUID_TYPE_SECONDARY   2
index 123f43f5332a441daa0fc8abdd1bb1e4b64a5f84..d6cea5db49a3e285437d730b7f55fbcb2e5ab0ac 100644 (file)
@@ -1,6 +1,6 @@
 
 /*********************************************************
- * Copyright (C) 1998-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2018 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -45,6 +45,7 @@ typedef enum {
    CPUID_VENDOR_AMD,
    CPUID_VENDOR_CYRIX,
    CPUID_VENDOR_VIA,
+   CPUID_VENDOR_HIGON,
    CPUID_NUM_VENDORS
 } CpuidVendor;