mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-24 23:40:39 +01:00
Fixes
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
maskset = true; \
|
maskset = true; \
|
||||||
} \
|
} \
|
||||||
|
|
||||||
struct frequency* get_frequency_info(uint32_t core) {
|
struct frequency* get_frequency_info(uint32_t_t core) {
|
||||||
struct frequency* freq = emalloc(sizeof(struct frequency));
|
struct frequency* freq = emalloc(sizeof(struct frequency));
|
||||||
|
|
||||||
freq->measured = false;
|
freq->measured = false;
|
||||||
@@ -152,7 +152,7 @@ bool valid_extension(char ext) {
|
|||||||
|
|
||||||
struct extensions* get_extensions_from_str(char* str) {
|
struct extensions* get_extensions_from_str(char* str) {
|
||||||
struct extensions* ext = emalloc(sizeof(struct extensions));
|
struct extensions* ext = emalloc(sizeof(struct extensions));
|
||||||
ext->mask = ecalloc((RISCV_ISA_EXT_ID_MAX-1) * sizeof(bool));
|
ext->mask = ecalloc(RISCV_ISA_EXT_ID_MAX-1, sizeof(bool));
|
||||||
ext->str = NULL;
|
ext->str = NULL;
|
||||||
|
|
||||||
if(str == NULL) {
|
if(str == NULL) {
|
||||||
@@ -209,8 +209,8 @@ struct extensions* get_extensions_from_str(char* str) {
|
|||||||
return ext;
|
return ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 get_num_extensions(bool* mask) {
|
uint32_t get_num_extensions(bool* mask) {
|
||||||
uint32 num = 0;
|
uint32_t num = 0;
|
||||||
for (int i=0; i < RISCV_ISA_EXT_ID_MAX-1; i++) {
|
for (int i=0; i < RISCV_ISA_EXT_ID_MAX-1; i++) {
|
||||||
if (mask[i]) num++;
|
if (mask[i]) num++;
|
||||||
}
|
}
|
||||||
@@ -244,7 +244,7 @@ struct cpuInfo* get_cpu_info(void) {
|
|||||||
|
|
||||||
//TODO: Might be worth refactoring with other archs
|
//TODO: Might be worth refactoring with other archs
|
||||||
char* get_str_topology(struct cpuInfo* cpu, struct topology* topo) {
|
char* get_str_topology(struct cpuInfo* cpu, struct topology* topo) {
|
||||||
uint32_t size = 3+7+1;
|
uint32_t_t size = 3+7+1;
|
||||||
char* string = emalloc(sizeof(char)*size);
|
char* string = emalloc(sizeof(char)*size);
|
||||||
snprintf(string, size, "%d cores", topo->total_cores);
|
snprintf(string, size, "%d cores", topo->total_cores);
|
||||||
|
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ static const struct extension extension_list[] = {
|
|||||||
struct cpuInfo* get_cpu_info(void);
|
struct cpuInfo* get_cpu_info(void);
|
||||||
char* get_str_topology(struct cpuInfo* cpu, struct topology* topo);
|
char* get_str_topology(struct cpuInfo* cpu, struct topology* topo);
|
||||||
char* get_str_extensions(struct cpuInfo* cpu);
|
char* get_str_extensions(struct cpuInfo* cpu);
|
||||||
uint32 get_num_extensions(bool* mask);
|
uint32_t get_num_extensions(bool* mask);
|
||||||
void print_debug(struct cpuInfo* cpu);
|
void print_debug(struct cpuInfo* cpu);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user