diff --git a/src/arm/soc.c b/src/arm/soc.c index 8973b63..4c6678e 100644 --- a/src/arm/soc.c +++ b/src/arm/soc.c @@ -310,6 +310,7 @@ struct system_on_chip* get_soc() { struct system_on_chip* soc = malloc(sizeof(struct system_on_chip)); soc->raw_name = NULL; soc->soc_vendor = SOC_UNKNOWN; + soc->process = UNKNOWN; soc = guess_soc_from_cpuinfo(soc); if(soc->soc_vendor == SOC_UNKNOWN) { @@ -340,3 +341,18 @@ char* get_soc_name(struct system_on_chip* soc) { return soc->soc_name; } +char* get_str_process(struct system_on_chip* soc) { + char* str; + + if(soc->process == UNKNOWN) { + str = malloc(sizeof(char) * (strlen(STRING_UNKNOWN)+1)); + snprintf(str, strlen(STRING_UNKNOWN)+1, STRING_UNKNOWN); + } + else { + str = malloc(sizeof(char) * 5); + memset(str, 0, sizeof(char) * 5); + snprintf(str, 5, "%dnm", soc->process); + } + return str; +} + diff --git a/src/arm/soc.h b/src/arm/soc.h index db2c9bf..88802b8 100644 --- a/src/arm/soc.h +++ b/src/arm/soc.h @@ -21,5 +21,6 @@ struct system_on_chip { struct system_on_chip* get_soc(); char* get_soc_name(struct system_on_chip* soc); +char* get_str_process(struct system_on_chip* soc); #endif diff --git a/src/arm/uarch.c b/src/arm/uarch.c index 1a3c890..d9a4724 100644 --- a/src/arm/uarch.c +++ b/src/arm/uarch.c @@ -275,12 +275,6 @@ char* get_str_uarch(struct cpuInfo* cpu) { return cpu->arch->uarch_str; } -char* get_str_process(struct cpuInfo* cpu) { - char* str = malloc(sizeof(char) * (strlen(STRING_UNKNOWN)+1)); - snprintf(str, strlen(STRING_UNKNOWN)+1, STRING_UNKNOWN); - return str; -} - void free_uarch_struct(struct uarch* arch) { free(arch->uarch_str); free(arch); diff --git a/src/arm/uarch.h b/src/arm/uarch.h index 7359519..edb69ab 100644 --- a/src/arm/uarch.h +++ b/src/arm/uarch.h @@ -7,7 +7,6 @@ struct uarch* get_uarch_from_midr(uint32_t midr, struct cpuInfo* cpu); char* get_str_uarch(struct cpuInfo* cpu); -char* get_str_process(struct cpuInfo* cpu); void free_uarch_struct(struct uarch* arch); #endif diff --git a/src/common/main.c b/src/common/main.c index 22481de..2b54ecf 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -13,7 +13,7 @@ #include "../arm/midr.h" #endif -static const char* VERSION = "0.90"; +static const char* VERSION = "0.91"; void print_help(char *argv[]) { printf("Usage: %s [--version] [--help] [--debug] [--style \"fancy\"|\"retro\"|\"legacy\"] [--color \"intel\"|\"amd\"|'R,G,B:R,G,B:R,G,B:R,G,B']\n\n", argv[0]); diff --git a/src/common/printer.c b/src/common/printer.c index 068e8ff..a5fe76b 100644 --- a/src/common/printer.c +++ b/src/common/printer.c @@ -542,7 +542,7 @@ void print_ascii(struct ascii* art) { } bool print_cpufetch_arm(struct ascii* art, struct cpuInfo* cpu, struct colors* cs) { - char* manufacturing_process = get_str_process(cpu); + char* manufacturing_process = get_str_process(cpu->soc); char* soc_name = get_soc_name(cpu->soc); setAttribute(art,ATTRIBUTE_SOC,soc_name); setAttribute(art,ATTRIBUTE_TECHNOLOGY,manufacturing_process);