From 14df701707a70042eed9ebf5f542bda09b7bfe39 Mon Sep 17 00:00:00 2001 From: Dr-Noob Date: Mon, 5 Feb 2024 08:46:17 +0000 Subject: [PATCH] [v1.04] Check release when printing error also in Apple chip failures --- src/arm/midr.c | 2 +- src/arm/soc.c | 8 ++++---- src/arm/uarch.c | 2 +- src/common/global.c | 2 +- src/common/global.h | 2 +- src/x86/uarch.c | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/arm/midr.c b/src/arm/midr.c index e787c25..1c84895 100644 --- a/src/arm/midr.c +++ b/src/arm/midr.c @@ -390,7 +390,7 @@ struct cpuInfo* get_cpu_info_mach(struct cpuInfo* cpu) { cpu->peak_performance = get_peak_performance(cpu); } else { - printBug("Found invalid cpu_family: 0x%.8X", cpu_family); + printBugCheckRelease("Found invalid cpu_family: 0x%.8X", cpu_family); return NULL; } diff --git a/src/arm/soc.c b/src/arm/soc.c index 2b58e9a..d62fa30 100644 --- a/src/arm/soc.c +++ b/src/arm/soc.c @@ -878,7 +878,7 @@ struct system_on_chip* guess_soc_apple(struct system_on_chip* soc) { } } else { - printBug("Found invalid cpu_subfamily: 0x%.8X", cpu_subfamily); + printBugCheckRelease("Found invalid cpu_subfamily: 0x%.8X", cpu_subfamily); soc->soc_vendor = SOC_VENDOR_UNKNOWN; } } @@ -905,7 +905,7 @@ struct system_on_chip* guess_soc_apple(struct system_on_chip* soc) { } } else { - printBug("Found invalid cpu_subfamily: 0x%.8X", cpu_subfamily); + printBugCheckRelease("Found invalid cpu_subfamily: 0x%.8X", cpu_subfamily); soc->soc_vendor = SOC_VENDOR_UNKNOWN; } } @@ -923,12 +923,12 @@ struct system_on_chip* guess_soc_apple(struct system_on_chip* soc) { fill_soc(soc, "M3 Max", SOC_APPLE_M3_MAX, 3); } else { - printBug("Found invalid cpu_family: 0x%.8X", cpu_family); + printBugCheckRelease("Found invalid cpu_family: 0x%.8X", cpu_family); soc->soc_vendor = SOC_VENDOR_UNKNOWN; } } else { - printBug("Found invalid cpu_family: 0x%.8X", cpu_family); + printBugCheckRelease("Found invalid cpu_family: 0x%.8X", cpu_family); soc->soc_vendor = SOC_VENDOR_UNKNOWN; } return soc; diff --git a/src/arm/uarch.c b/src/arm/uarch.c index c8e44b0..79522a3 100644 --- a/src/arm/uarch.c +++ b/src/arm/uarch.c @@ -200,7 +200,7 @@ static char* isas_string[] = { #define UARCH_START if (false) {} #define CHECK_UARCH(arch, cpu, im_, p_, v_, r_, str, uarch, vendor) \ else if (im_ == im && p_ == p && (v_ == NA || v_ == v) && (r_ == NA || r_ == r)) fill_uarch(arch, cpu, str, uarch, vendor); -#define UARCH_END else { printUnknownUarch("Unknown microarchitecture detected: M=0x%X EM=0x%X F=0x%X EF=0x%X S=0x%X", m, em, f, ef, s); \ +#define UARCH_END else { printBugCheckRelease("Unknown microarchitecture detected: M=0x%X EM=0x%X F=0x%X EF=0x%X S=0x%X", m, em, f, ef, s); \ fill_uarch(arch, cpu, "Unknown", UARCH_UNKNOWN, CPU_VENDOR_UNKNOWN); } void fill_uarch(struct uarch* arch, struct cpuInfo* cpu, char* str, MICROARCH u, VENDOR vendor) { diff --git a/src/common/global.c b/src/common/global.c index 945b649..a0e8944 100644 --- a/src/common/global.c +++ b/src/common/global.c @@ -116,7 +116,7 @@ bool isReleaseVersion(char *git_full_version) { /// the release version. In such case, support for this feature is most likely already /// in the last version, so just tell the user to compile that one and not report this /// in github. -void printUnknownUarch(const char *fmt, ...) { +void printBugCheckRelease(const char *fmt, ...) { int buffer_size = 4096; char buffer[buffer_size]; va_list args; diff --git a/src/common/global.h b/src/common/global.h index cd28d6f..69ead1d 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -12,7 +12,7 @@ void set_log_level(bool verbose); void printWarn(const char *fmt, ...); void printErr(const char *fmt, ...); void printBug(const char *fmt, ...); -void printUnknownUarch(const char *fmt, ...); +void printBugCheckRelease(const char *fmt, ...); int min(int a, int b); int max(int a, int b); char *strremove(char *str, const char *sub); diff --git a/src/x86/uarch.c b/src/x86/uarch.c index e2ff943..3c8644f 100644 --- a/src/x86/uarch.c +++ b/src/x86/uarch.c @@ -125,7 +125,7 @@ struct uarch { #define UARCH_START if (false) {} #define CHECK_UARCH(arch, ef_, f_, em_, m_, s_, str, uarch, process) \ else if (ef_ == ef && f_ == f && (em_ == NA || em_ == em) && (m_ == NA || m_ == m) && (s_ == NA || s_ == s)) fill_uarch(arch, str, uarch, process); -#define UARCH_END else { printUnknownUarch("Unknown microarchitecture detected: M=0x%X EM=0x%X F=0x%X EF=0x%X S=0x%X", m, em, f, ef, s); \ +#define UARCH_END else { printBugCheckRelease("Unknown microarchitecture detected: M=0x%X EM=0x%X F=0x%X EF=0x%X S=0x%X", m, em, f, ef, s); \ fill_uarch(arch, STRING_UNKNOWN, UARCH_UNKNOWN, UNK); } void fill_uarch(struct uarch* arch, char* str, MICROARCH u, uint32_t process) {