mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 07:50:40 +01:00
[v0.98][PPC] Add max frequency detection
This commit is contained in:
@@ -568,7 +568,7 @@ bool print_cpufetch_ppc(struct cpuInfo* cpu, STYLE s, struct colors* cs) {
|
||||
char* uarch = get_str_uarch(cpu);
|
||||
char* manufacturing_process = get_str_process(cpu);
|
||||
char* sockets = get_str_sockets(cpu->topo);
|
||||
// char* max_frequency = get_str_freq(cpu->freq);
|
||||
char* max_frequency = get_str_freq(cpu->freq);
|
||||
char* n_cores = get_str_topology(cpu, cpu->topo, false);
|
||||
char* n_cores_dual = get_str_topology(cpu, cpu->topo, true);
|
||||
char* cpu_name = get_str_cpu_name(cpu);
|
||||
@@ -587,7 +587,7 @@ bool print_cpufetch_ppc(struct cpuInfo* cpu, STYLE s, struct colors* cs) {
|
||||
}*/
|
||||
setAttribute(art,ATTRIBUTE_UARCH,uarch);
|
||||
setAttribute(art,ATTRIBUTE_TECHNOLOGY,manufacturing_process);
|
||||
//setAttribute(art,ATTRIBUTE_FREQUENCY,max_frequency);
|
||||
setAttribute(art,ATTRIBUTE_FREQUENCY,max_frequency);
|
||||
uint32_t socket_num = get_nsockets(cpu->topo);
|
||||
if (socket_num > 1) {
|
||||
setAttribute(art, ATTRIBUTE_SOCKETS, sockets);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "ppc.h"
|
||||
#include "udev.h"
|
||||
#include "../common/udev.h"
|
||||
|
||||
#define STRING_UNKNOWN "Unknown"
|
||||
|
||||
@@ -118,6 +119,15 @@ struct uarch* get_cpu_uarch() {
|
||||
return get_uarch_from_pvr(pvr);
|
||||
}
|
||||
|
||||
struct frequency* get_frequency_info() {
|
||||
struct frequency* freq = malloc(sizeof(struct frequency));
|
||||
|
||||
freq->max = get_max_freq_from_file(0, false);
|
||||
freq->base = get_min_freq_from_file(0, false);
|
||||
|
||||
return freq;
|
||||
}
|
||||
|
||||
struct cpuInfo* get_cpu_info() {
|
||||
struct cpuInfo* cpu = malloc(sizeof(struct cpuInfo));
|
||||
struct features* feat = malloc(sizeof(struct features));
|
||||
@@ -132,6 +142,7 @@ struct cpuInfo* get_cpu_info() {
|
||||
snprintf(cpu->cpu_name, strlen(STRING_UNKNOWN) + 1, STRING_UNKNOWN);
|
||||
|
||||
cpu->arch = get_cpu_uarch();
|
||||
cpu->freq = get_frequency_info();
|
||||
cpu->cach = get_cache_info(cpu);
|
||||
cpu->topo = get_topology_info(cpu, cpu->cach);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user