diff --git a/src/arm/udev.c b/src/arm/udev.c index 02d782b..873edca 100644 --- a/src/arm/udev.c +++ b/src/arm/udev.c @@ -1,3 +1,4 @@ +#include "../common/global.h" #include "udev.h" #include "midr.h" diff --git a/src/common/global.h b/src/common/global.h index 5e090f0..92afce2 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -2,6 +2,7 @@ #define __GLOBAL__ #include +#include void set_log_level(bool verbose); void printWarn(const char *fmt, ...); diff --git a/src/x86/cpuid.c b/src/x86/cpuid.c index e01e9f8..6c307d8 100644 --- a/src/x86/cpuid.c +++ b/src/x86/cpuid.c @@ -671,13 +671,16 @@ struct frequency* get_frequency_info(struct cpuInfo* cpu) { freq->base = UNKNOWN_FREQ; } if(freq->max == 0) { - printWarn("Read max CPU frequency from CPUID and got 0 MHz. Using udev"); - freq->max = get_max_freq_from_file(0, cpu->hv->present); + printWarn("Read max CPU frequency from CPUID and got 0 MHz"); + #ifdef __linux__ + printWarn("Using udev to detect frequency"); + freq->max = get_max_freq_from_file(0, cpu->hv->present); - if(freq->max == 0) { - printWarn("Read max CPU frequency from udev and got 0 MHz"); - freq->max = UNKNOWN_FREQ; - } + if(freq->max == 0) { + printWarn("Read max CPU frequency from udev and got 0 MHz"); + freq->max = UNKNOWN_FREQ; + } + #endif } }