diff --git a/go_bindings/Sigar/src/os/win32/win32_sigar.c b/go_bindings/Sigar/src/os/win32/win32_sigar.c index b79ee2076..0f4f8df22 100644 --- a/go_bindings/Sigar/src/os/win32/win32_sigar.c +++ b/go_bindings/Sigar/src/os/win32/win32_sigar.c @@ -2215,6 +2215,9 @@ static int sigar_cpu_info_get(sigar_t *sigar, sigar_cpu_info_t *info) if (strEQ(info->vendor, "AuthenticAMD")) { SIGAR_SSTRCPY(info->vendor, "AMD"); } + else if (strEQ(info->vendor, "HygonGenuine")) { + SIGAR_SSTRCPY(info->vendor, "Hygon"); + } } size = sizeof(info->model); diff --git a/src/os/linux/linux_sigar.c b/src/os/linux/linux_sigar.c index a3fd23010..4a0fd1a0d 100644 --- a/src/os/linux/linux_sigar.c +++ b/src/os/linux/linux_sigar.c @@ -1559,6 +1559,9 @@ static int get_cpu_info(sigar_t *sigar, sigar_cpu_info_t *info, else if (strEQ(info->vendor, "AuthenticAMD")) { SIGAR_SSTRCPY(info->vendor, "AMD"); } + else if (strEQ(info->vendor, "HygonGenuine")) { + SIGAR_SSTRCPY(info->vendor, "Hygon"); + } } break; case 'f': diff --git a/src/os/win32/win32_sigar.c b/src/os/win32/win32_sigar.c index b79ee2076..0f4f8df22 100755 --- a/src/os/win32/win32_sigar.c +++ b/src/os/win32/win32_sigar.c @@ -2215,6 +2215,9 @@ static int sigar_cpu_info_get(sigar_t *sigar, sigar_cpu_info_t *info) if (strEQ(info->vendor, "AuthenticAMD")) { SIGAR_SSTRCPY(info->vendor, "AMD"); } + else if (strEQ(info->vendor, "HygonGenuine")) { + SIGAR_SSTRCPY(info->vendor, "Hygon"); + } } size = sizeof(info->model); diff --git a/src/sigar_util.c b/src/sigar_util.c index 3c668fc63..727b61858 100644 --- a/src/sigar_util.c +++ b/src/sigar_util.c @@ -554,6 +554,7 @@ static void sigar_cpuid(sigar_uint32_t request, #define INTEL_ID 0x756e6547 #define AMD_ID 0x68747541 +#define HYGON_ID 0x6f677948 int sigar_cpu_core_count(sigar_t *sigar) { @@ -565,7 +566,7 @@ int sigar_cpu_core_count(sigar_t *sigar) sigar_cpuid(0, &id); - if ((id.ebx == INTEL_ID) || (id.ebx == AMD_ID)) { + if ((id.ebx == INTEL_ID) || (id.ebx == AMD_ID) || (id.ebx == HYGON_ID)) { sigar_cpuid(1, &id); if (id.edx & (1<<28)) {