From 697a921042de40e047772871c354c6704edd85bf Mon Sep 17 00:00:00 2001 From: Dr-Noob Date: Sun, 10 Jan 2021 09:01:50 +0100 Subject: [PATCH] [X86] Avoid checking /sys directory in macOS to find frequency --- src/x86/apic.c | 2 +- src/x86/cpuid.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/x86/apic.c b/src/x86/apic.c index 518cd02..f42fba6 100644 --- a/src/x86/apic.c +++ b/src/x86/apic.c @@ -286,7 +286,7 @@ void add_apic_to_array(uint32_t apic, uint32_t* apic_ids, int n) { bool fill_apic_ids(uint32_t* apic_ids, int n, bool x2apic_id) { #ifdef __APPLE__ // macOS extremely dirty approach... - printf("cpufetch is computing APIC IDs, please wait..."); + printf("cpufetch is computing APIC IDs, please wait...\n"); bool end = false; uint32_t apic; for(int i=0; i < n; i++) apic_ids[i] = (uint32_t) -1; diff --git a/src/x86/cpuid.c b/src/x86/cpuid.c index fc3fde5..83faf84 100755 --- a/src/x86/cpuid.c +++ b/src/x86/cpuid.c @@ -668,6 +668,10 @@ struct frequency* get_frequency_info(struct cpuInfo* cpu) { } freq->base = UNKNOWN_FREQ; freq->max = UNKNOWN_FREQ; + #elif defined __APPLE__ + printErr("Can't read frequency information from cpuid (needed level is 0x%.8X, max is 0x%.8X)", 0x00000016, cpu->maxLevels); + freq->base = UNKNOWN_FREQ; + freq->max = UNKNOWN_FREQ; #else printWarn("Can't read frequency information from cpuid (needed level is 0x%.8X, max is 0x%.8X). Using udev", 0x00000016, cpu->maxLevels); freq->base = UNKNOWN_FREQ;