mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 07:50:40 +01:00
[v0.91][ARM] Print manufacturing process from SoC information
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user