[v1.05] Implement new approach to infer SoC from the uarch. Add support for Kunpeng SoCs

This commit is contained in:
Dr-Noob
2024-02-08 09:04:51 +00:00
parent b610dc8c7d
commit c01f60fa6c
14 changed files with 171 additions and 97 deletions

View File

@@ -163,7 +163,7 @@ struct cpuInfo* get_cpu_info(void) {
cpu->ext = get_extensions_from_str(ext_str);
if(cpu->ext->str != NULL && cpu->ext->mask == 0) return NULL;
cpu->arch = get_uarch_from_cpuinfo_str(cpuinfo_str, cpu);
cpu->soc = get_soc();
cpu->soc = get_soc(cpu);
cpu->freq = get_frequency_info(0);
cpu->peak_performance = get_peak_performance(cpu);

View File

@@ -65,7 +65,7 @@ struct system_on_chip* guess_soc_from_devtree(struct system_on_chip* soc) {
return soc;
}
struct system_on_chip* get_soc(void) {
struct system_on_chip* get_soc(struct cpuInfo* cpu) {
struct system_on_chip* soc = emalloc(sizeof(struct system_on_chip));
soc->raw_name = NULL;
soc->soc_vendor = SOC_VENDOR_UNKNOWN;

View File

@@ -5,6 +5,6 @@
#include "../common/cpu.h"
#include <stdint.h>
struct system_on_chip* get_soc(void);
struct system_on_chip* get_soc(struct cpuInfo* cpu);
#endif