[v1.05] Experimental max frequency measurement (x86 only)

This commit is contained in:
Dr-Noob
2024-02-14 08:48:27 +00:00
parent cc16bc56ef
commit 72eee0e08e
6 changed files with 190 additions and 2 deletions

View File

@@ -6,6 +6,10 @@
#include <unistd.h>
#endif
#ifdef __linux__
#include "../common/freq.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -960,6 +964,13 @@ struct frequency* get_frequency_info(struct cpuInfo* cpu) {
}
}
#ifdef __linux__
if (freq->max == UNKNOWN_DATA) {
printWarn("All previous methods failed, measuring CPU frequency");
freq->max = measure_max_frequency();
}
#endif
return freq;
}