mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 16:00:39 +01:00
[v0.8][Refactoring] Refactoring ARM code and source code tree
This commit is contained in:
@@ -4,23 +4,18 @@
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "cpuid.h"
|
||||
#include "midr.h"
|
||||
|
||||
struct frequency {
|
||||
int64_t base;
|
||||
int64_t max;
|
||||
};
|
||||
|
||||
struct cpuInfo* get_cpu_info() {
|
||||
struct cpuInfo* get_cpu_info() {
|
||||
struct cpuInfo* cpu = malloc(sizeof(struct cpuInfo));
|
||||
|
||||
|
||||
cpu->cpu_vendor = CPU_VENDOR_UNKNOWN;
|
||||
cpu->cpu_name = malloc(sizeof(char) * CPU_NAME_MAX_LENGTH);
|
||||
strcpy(cpu->cpu_name, "Unknown");
|
||||
cpu->arch = NULL;
|
||||
cpu->hv = malloc(sizeof(struct hypervisor));
|
||||
cpu->hv->present = false;
|
||||
|
||||
|
||||
return cpu;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef __CPUID__
|
||||
#define __CPUID__
|
||||
#ifndef __MIDR__
|
||||
#define __MIDR__
|
||||
|
||||
#include "../common/cpu.h"
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
#include "../common/global.h"
|
||||
|
||||
struct uarch* get_uarch_from_cpuid(struct cpuInfo* cpu, uint32_t ef, uint32_t f, uint32_t em, uint32_t m, int s) { return NULL; }
|
||||
bool vpus_are_AVX512(struct cpuInfo* cpu) { return false; }
|
||||
bool is_knights_landing(struct cpuInfo* cpu) { return false; }
|
||||
int get_number_of_vpus(struct cpuInfo* cpu) { return 0; }
|
||||
char* get_str_uarch(struct cpuInfo* cpu) { char* tmp = malloc(sizeof(char) * 10); strcpy(tmp, "Unknown"); return tmp; }
|
||||
char* get_str_process(struct cpuInfo* cpu) { char* tmp = malloc(sizeof(char) * 10); strcpy(tmp, "Unknown"); return tmp; }
|
||||
void free_uarch_struct(struct uarch* arch) { }
|
||||
|
||||
@@ -3,14 +3,11 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "cpuid.h"
|
||||
#include "midr.h"
|
||||
|
||||
struct uarch;
|
||||
|
||||
struct uarch* get_uarch_from_cpuid(struct cpuInfo* cpu, uint32_t ef, uint32_t f, uint32_t em, uint32_t m, int s);
|
||||
bool vpus_are_AVX512(struct cpuInfo* cpu);
|
||||
bool is_knights_landing(struct cpuInfo* cpu);
|
||||
int get_number_of_vpus(struct cpuInfo* cpu);
|
||||
char* get_str_uarch(struct cpuInfo* cpu);
|
||||
char* get_str_process(struct cpuInfo* cpu);
|
||||
void free_uarch_struct(struct uarch* arch);
|
||||
|
||||
Reference in New Issue
Block a user