diff --git a/src/common/ascii.h b/src/common/ascii.h index 302de8c5..0dfdee27 100644 --- a/src/common/ascii.h +++ b/src/common/ascii.h @@ -105,6 +105,23 @@ struct ascii_logo { $C1 MMM :MMM NMM dMMMoo OMM0....:Nx. MMN \ $C1 MMM :WWW XWW lONMM 'xXMMMMNOc MMN " +// TODO real logo +#define ASCII_HYGON \ +"$C1 .#################. \ +$C1 .#### ####. \ +$C1 .## ### \ +$C1 ## :## ### \ +$C1 # ## :## ## \ +$C1 ## ## ######. #### ###### :## ## \ +$C1 ## ## ##: ##: ## ## ### :## ### \ +$C1## ## ##: ##: ## :######## :## ## \ +$C1## ## ##: ##: ## ##. . :## #### \ +$C1## # ##: ##: #### #####: ## \ +$C1 ## \ +$C1 ###. ..o####. \ +$C1 ######oo... ..oo####### \ +$C1 o###############o " + #define ASCII_SNAPD \ " $C1@@$C2######## \ $C1@@@@@$C2########### \ @@ -538,6 +555,7 @@ typedef struct ascii_logo asciiL; asciiL logo_amd = { ASCII_AMD, 39, 15, false, {C_FG_WHITE, C_FG_GREEN}, {C_FG_WHITE, C_FG_GREEN} }; asciiL logo_intel = { ASCII_INTEL, 48, 14, false, {C_FG_CYAN}, {C_FG_CYAN, C_FG_WHITE} }; asciiL logo_intel_new = { ASCII_INTEL_NEW, 51, 9, false, {C_FG_CYAN}, {C_FG_CYAN, C_FG_WHITE} }; +asciiL logo_hygon = { ASCII_HYGON, 48, 14, false, {C_FG_CYAN}, {C_FG_CYAN, C_FG_WHITE} }; asciiL logo_snapd = { ASCII_SNAPD, 39, 16, false, {C_FG_RED, C_FG_WHITE}, {C_FG_RED, C_FG_WHITE} }; asciiL logo_mtk = { ASCII_MTK, 59, 5, false, {C_FG_BLUE, C_FG_YELLOW}, {C_FG_BLUE, C_FG_YELLOW} }; asciiL logo_exynos = { ASCII_EXYNOS, 22, 13, true, {C_BG_BLUE, C_FG_WHITE}, {C_FG_BLUE, C_FG_WHITE} }; diff --git a/src/common/cpu.h b/src/common/cpu.h index da023e07..ac6bb78f 100644 --- a/src/common/cpu.h +++ b/src/common/cpu.h @@ -8,6 +8,7 @@ enum { // ARCH_X86 CPU_VENDOR_INTEL, CPU_VENDOR_AMD, + CPU_VENDOR_HYGON, // ARCH_ARM CPU_VENDOR_ARM, CPU_VENDOR_APPLE, diff --git a/src/common/printer.c b/src/common/printer.c index 1a43e5fd..6b511f3d 100644 --- a/src/common/printer.c +++ b/src/common/printer.c @@ -357,6 +357,9 @@ void choose_ascii_art(struct ascii* art, struct color** cs, struct terminal* ter else if(art->vendor == CPU_VENDOR_AMD) { art->art = choose_ascii_art_aux(&logo_amd_l, &logo_amd, term, lf); } + else if(art->vendor == CPU_VENDOR_HYGON) { + art->art = &logo_hygon; + } else { art->art = &logo_unknown; } diff --git a/src/x86/cpuid.c b/src/x86/cpuid.c index 5f93afe8..64601dc9 100644 --- a/src/x86/cpuid.c +++ b/src/x86/cpuid.c @@ -22,6 +22,7 @@ #define CPU_VENDOR_INTEL_STRING "GenuineIntel" #define CPU_VENDOR_AMD_STRING "AuthenticAMD" +#define CPU_VENDOR_HYGON_STRING "HygonGenuine" static const char *hv_vendors_string[] = { [HV_VENDOR_KVM] = "KVMKVMKVM", @@ -470,6 +471,8 @@ struct cpuInfo* get_cpu_info(void) { cpu->cpu_vendor = CPU_VENDOR_INTEL; else if (strcmp(CPU_VENDOR_AMD_STRING,name) == 0) cpu->cpu_vendor = CPU_VENDOR_AMD; + else if (strcmp(CPU_VENDOR_HYGON_STRING,name) == 0) + cpu->cpu_vendor = CPU_VENDOR_HYGON; else { cpu->cpu_vendor = CPU_VENDOR_INVALID; printErr("Unknown CPU vendor: %s", name); @@ -718,6 +721,7 @@ struct topology* get_topology_info(struct cpuInfo* cpu, struct cache* cach, int } break; case CPU_VENDOR_AMD: + case CPU_VENDOR_HYGON: if (cpu->maxExtendedLevels >= 0x80000008) { eax = 0x80000008; cpuid(&eax, &ebx, &ecx, &edx);