[v1.03][RISCV] Implementing basic skeleton for RISC-V backend

This commit is contained in:
Dr-Noob
2023-04-01 16:46:54 +02:00
parent 1f450b23a1
commit 9a69a7f58d
10 changed files with 141 additions and 6 deletions

View File

@@ -3,8 +3,35 @@
#include <string.h>
#include <ctype.h>
#include "../common/global.h"
#include "../common/udev.h"
struct frequency* get_frequency_info(uint32_t core) {
struct frequency* freq = emalloc(sizeof(struct frequency));
freq->base = UNKNOWN_DATA;
freq->max = get_max_freq_from_file(core);
return freq;
}
struct cpuInfo* get_cpu_info(void) {
return NULL;
struct cpuInfo* cpu = malloc(sizeof(struct cpuInfo));
//init_cpu_info(cpu);
int ncores = get_ncores_from_cpuinfo();
cpu->hv = emalloc(sizeof(struct hypervisor));
cpu->hv->present = false;
//cpu->soc = get_soc();
//cpu->peak_performance = get_peak_performance(cpu);
cpu->peak_performance = 0;
cpu->freq = get_frequency_info(0);
cpu->cpu_vendor = CPU_VENDOR_RISCV;
return cpu;
}
char* get_str_topology(struct cpuInfo* cpu, struct topology* topo) {
return "Many cores";
}
void print_debug(struct cpuInfo* cpu) {