[v0.98][Refactoring] Do not use hv_present in get_freq_from_file

This commit is contained in:
Dr-Noob
2021-08-07 10:38:32 +02:00
parent fba69daee0
commit 5737f1ecaf
5 changed files with 16 additions and 20 deletions

View File

@@ -28,15 +28,11 @@ char* read_file(char* path, int* len) {
return buf;
}
long get_freq_from_file(char* path, bool hv_present) {
long get_freq_from_file(char* path) {
int filelen;
char* buf;
if((buf = read_file(path, &filelen)) == NULL) {
if(hv_present)
printWarn("Could not open '%s' (HV is present)", path);
else
printWarn("Could not open '%s'", path);
printWarn("Could not open '%s'", path);
return UNKNOWN_FREQ;
}
@@ -86,16 +82,16 @@ long get_cache_size_from_file(char* path) {
return ret * 1024;
}
long get_max_freq_from_file(uint32_t core, bool hv_present) {
long get_max_freq_from_file(uint32_t core) {
char path[_PATH_FREQUENCY_MAX_LEN];
sprintf(path, "%s%s/cpu%d%s%s", _PATH_SYS_SYSTEM, _PATH_SYS_CPU, core, _PATH_FREQUENCY, _PATH_FREQUENCY_MAX);
return get_freq_from_file(path, hv_present);
return get_freq_from_file(path);
}
long get_min_freq_from_file(uint32_t core, bool hv_present) {
long get_min_freq_from_file(uint32_t core) {
char path[_PATH_FREQUENCY_MAX_LEN];
sprintf(path, "%s%s/cpu%d%s%s", _PATH_SYS_SYSTEM, _PATH_SYS_CPU, core, _PATH_FREQUENCY, _PATH_FREQUENCY_MIN);
return get_freq_from_file(path, hv_present);
return get_freq_from_file(path);
}
long get_l1i_cache_size(uint32_t core) {

View File

@@ -29,8 +29,8 @@
#define DEFAULT_FILE_SIZE 4096
char* read_file(char* path, int* len);
long get_max_freq_from_file(uint32_t core, bool hv_present);
long get_min_freq_from_file(uint32_t core, bool hv_present);
long get_max_freq_from_file(uint32_t core);
long get_min_freq_from_file(uint32_t core);
long get_l1i_cache_size(uint32_t core);
long get_l1d_cache_size(uint32_t core);
long get_l2_cache_size(uint32_t core);