mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 07:50:40 +01:00
[v1.03] Add common soc.c/.h for both ARM and RISC-V
This commit is contained in:
8
Makefile
8
Makefile
@@ -32,8 +32,8 @@ ifneq ($(OS),Windows_NT)
|
|||||||
CFLAGS += -DARCH_PPC -std=gnu99 -fstack-protector-all -Wno-language-extension-token
|
CFLAGS += -DARCH_PPC -std=gnu99 -fstack-protector-all -Wno-language-extension-token
|
||||||
else ifeq ($(arch), $(filter $(arch), arm aarch64_be aarch64 arm64 armv8b armv8l armv7l armv6l))
|
else ifeq ($(arch), $(filter $(arch), arm aarch64_be aarch64 arm64 armv8b armv8l armv7l armv6l))
|
||||||
SRC_DIR=src/arm/
|
SRC_DIR=src/arm/
|
||||||
SOURCE += $(COMMON_SRC) $(SRC_DIR)midr.c $(SRC_DIR)uarch.c $(SRC_DIR)soc.c $(SRC_DIR)udev.c
|
SOURCE += $(COMMON_SRC) $(SRC_DIR)midr.c $(SRC_DIR)uarch.c $(SRC_COMMON)soc.c $(SRC_DIR)soc.c $(SRC_DIR)udev.c
|
||||||
HEADERS += $(COMMON_HDR) $(SRC_DIR)midr.h $(SRC_DIR)uarch.h $(SRC_DIR)soc.h $(SRC_DIR)udev.c $(SRC_DIR)socs.h
|
HEADERS += $(COMMON_HDR) $(SRC_DIR)midr.h $(SRC_DIR)uarch.h $(SRC_COMMON)soc.h $(SRC_DIR)soc.h $(SRC_DIR)udev.c $(SRC_DIR)socs.h
|
||||||
CFLAGS += -DARCH_ARM -Wno-unused-parameter -std=c99 -fstack-protector-all
|
CFLAGS += -DARCH_ARM -Wno-unused-parameter -std=c99 -fstack-protector-all
|
||||||
|
|
||||||
os := $(shell uname -s)
|
os := $(shell uname -s)
|
||||||
@@ -43,8 +43,8 @@ ifneq ($(OS),Windows_NT)
|
|||||||
endif
|
endif
|
||||||
else ifeq ($(arch), $(filter $(arch), riscv64 riscv32))
|
else ifeq ($(arch), $(filter $(arch), riscv64 riscv32))
|
||||||
SRC_DIR=src/riscv/
|
SRC_DIR=src/riscv/
|
||||||
SOURCE += $(COMMON_SRC) $(SRC_DIR)riscv.c $(SRC_DIR)uarch.c $(SRC_DIR)soc.c $(SRC_DIR)udev.c
|
SOURCE += $(COMMON_SRC) $(SRC_DIR)riscv.c $(SRC_DIR)uarch.c $(SRC_COMMON)soc.c $(SRC_DIR)soc.c $(SRC_DIR)udev.c
|
||||||
HEADERS += $(COMMON_HDR) $(SRC_DIR)riscv.h $(SRC_DIR)uarch.h $(SRC_DIR)soc.h $(SRC_DIR)udev.h $(SRC_DIR)socs.h
|
HEADERS += $(COMMON_HDR) $(SRC_DIR)riscv.h $(SRC_DIR)uarch.h $(SRC_COMMON)soc.h $(SRC_DIR)soc.h $(SRC_DIR)udev.h $(SRC_DIR)socs.h
|
||||||
CFLAGS += -DARCH_RISCV -Wno-unused-parameter -std=c99 -fstack-protector-all
|
CFLAGS += -DARCH_RISCV -Wno-unused-parameter -std=c99 -fstack-protector-all
|
||||||
else
|
else
|
||||||
# Error lines should not be tabulated because Makefile complains about it
|
# Error lines should not be tabulated because Makefile complains about it
|
||||||
|
|||||||
@@ -13,10 +13,10 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../common/global.h"
|
#include "../common/global.h"
|
||||||
|
#include "../common/soc.h"
|
||||||
#include "udev.h"
|
#include "udev.h"
|
||||||
#include "midr.h"
|
#include "midr.h"
|
||||||
#include "uarch.h"
|
#include "uarch.h"
|
||||||
#include "soc.h"
|
|
||||||
|
|
||||||
bool cores_are_equal(int c1pos, int c2pos, uint32_t* midr_array, int32_t* freq_array) {
|
bool cores_are_equal(int c1pos, int c2pos, uint32_t* midr_array, int32_t* freq_array) {
|
||||||
return midr_array[c1pos] == midr_array[c2pos] && freq_array[c1pos] == freq_array[c2pos];
|
return midr_array[c1pos] == midr_array[c2pos] && freq_array[c1pos] == freq_array[c2pos];
|
||||||
|
|||||||
@@ -15,17 +15,6 @@
|
|||||||
#define min(a,b) (((a)<(b))?(a):(b))
|
#define min(a,b) (((a)<(b))?(a):(b))
|
||||||
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
|
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
|
||||||
|
|
||||||
static char* soc_trademark_string[] = {
|
|
||||||
[SOC_VENDOR_SNAPDRAGON] = "Snapdragon ",
|
|
||||||
[SOC_VENDOR_MEDIATEK] = "MediaTek ",
|
|
||||||
[SOC_VENDOR_EXYNOS] = "Exynos ",
|
|
||||||
[SOC_VENDOR_KIRIN] = "Kirin ",
|
|
||||||
[SOC_VENDOR_BROADCOM] = "Broadcom BCM",
|
|
||||||
[SOC_VENDOR_APPLE] = "Apple ",
|
|
||||||
[SOC_VENDOR_ALLWINNER] = "Allwinner ",
|
|
||||||
[SOC_VENDOR_ROCKCHIP] = "Rockchip ",
|
|
||||||
};
|
|
||||||
|
|
||||||
static char* soc_rpi_string[] = {
|
static char* soc_rpi_string[] = {
|
||||||
"BCM2835",
|
"BCM2835",
|
||||||
"BCM2836",
|
"BCM2836",
|
||||||
@@ -33,30 +22,6 @@ static char* soc_rpi_string[] = {
|
|||||||
"BCM2711"
|
"BCM2711"
|
||||||
};
|
};
|
||||||
|
|
||||||
void fill_soc(struct system_on_chip* soc, char* soc_name, SOC soc_model, int32_t process) {
|
|
||||||
soc->soc_model = soc_model;
|
|
||||||
soc->soc_vendor = get_soc_vendor_from_soc(soc_model);
|
|
||||||
soc->process = process;
|
|
||||||
int len = strlen(soc_name) + strlen(soc_trademark_string[soc->soc_vendor]) + 1;
|
|
||||||
soc->soc_name = emalloc(sizeof(char) * len);
|
|
||||||
memset(soc->soc_name, 0, sizeof(char) * len);
|
|
||||||
sprintf(soc->soc_name, "%s%s", soc_trademark_string[soc->soc_vendor], soc_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool match_soc(struct system_on_chip* soc, char* raw_name, char* expected_name, char* soc_name, SOC soc_model, int32_t process) {
|
|
||||||
int len1 = strlen(raw_name);
|
|
||||||
int len2 = strlen(expected_name);
|
|
||||||
int len = min(len1, len2);
|
|
||||||
|
|
||||||
if(strncmp(raw_name, expected_name, len) != 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
fill_soc(soc, soc_name, soc_model, process);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
char* toupperstr(char* str) {
|
char* toupperstr(char* str) {
|
||||||
int len = strlen(str) + 1;
|
int len = strlen(str) + 1;
|
||||||
char* ret = emalloc(sizeof(char) * len);
|
char* ret = emalloc(sizeof(char) * len);
|
||||||
@@ -123,11 +88,7 @@ bool get_sunxisoc_from_sid(struct system_on_chip* soc, char* raw_name, uint32_t
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SOC_START if (false) {}
|
// Exynos special define (not included in src/common/soc.h)
|
||||||
#define SOC_EQ(raw_name, expected_name, soc_name, soc_model, soc, process) \
|
|
||||||
else if (match_soc(soc, raw_name, expected_name, soc_name, soc_model, process)) return true;
|
|
||||||
#define SOC_END else { return false; }
|
|
||||||
// Exynos special define
|
|
||||||
#define SOC_EXY_EQ(raw_name, tmpsoc, soc_name, soc_model, soc, process) \
|
#define SOC_EXY_EQ(raw_name, tmpsoc, soc_name, soc_model, soc, process) \
|
||||||
sprintf(tmpsoc, "exynos%s", soc_name); \
|
sprintf(tmpsoc, "exynos%s", soc_name); \
|
||||||
if (match_soc(soc, raw_name, tmpsoc, soc_name, soc_model, process)) return true; \
|
if (match_soc(soc, raw_name, tmpsoc, soc_name, soc_model, process)) return true; \
|
||||||
@@ -871,28 +832,3 @@ struct system_on_chip* get_soc(void) {
|
|||||||
|
|
||||||
return soc;
|
return soc;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* get_soc_name(struct system_on_chip* soc) {
|
|
||||||
if(soc->soc_model == SOC_MODEL_UNKNOWN)
|
|
||||||
return soc->raw_name;
|
|
||||||
return soc->soc_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
VENDOR get_soc_vendor(struct system_on_chip* soc) {
|
|
||||||
return soc->soc_vendor;
|
|
||||||
}
|
|
||||||
|
|
||||||
char* get_str_process(struct system_on_chip* soc) {
|
|
||||||
char* str;
|
|
||||||
|
|
||||||
if(soc->process == UNKNOWN) {
|
|
||||||
str = emalloc(sizeof(char) * (strlen(STRING_UNKNOWN)+1));
|
|
||||||
snprintf(str, strlen(STRING_UNKNOWN)+1, STRING_UNKNOWN);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
str = emalloc(sizeof(char) * 5);
|
|
||||||
memset(str, 0, sizeof(char) * 5);
|
|
||||||
snprintf(str, 5, "%dnm", soc->process);
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,34 +1,10 @@
|
|||||||
#ifndef __SOC__
|
#ifndef __SOC_ARM__
|
||||||
#define __SOC__
|
#define __SOC_ARM__
|
||||||
|
|
||||||
#include "../common/cpu.h"
|
#include "../common/cpu.h"
|
||||||
|
#include "../common/soc.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
typedef int32_t SOC;
|
|
||||||
|
|
||||||
enum {
|
|
||||||
SOC_VENDOR_UNKNOWN,
|
|
||||||
SOC_VENDOR_SNAPDRAGON,
|
|
||||||
SOC_VENDOR_MEDIATEK,
|
|
||||||
SOC_VENDOR_EXYNOS,
|
|
||||||
SOC_VENDOR_KIRIN,
|
|
||||||
SOC_VENDOR_BROADCOM,
|
|
||||||
SOC_VENDOR_APPLE,
|
|
||||||
SOC_VENDOR_ALLWINNER,
|
|
||||||
SOC_VENDOR_ROCKCHIP
|
|
||||||
};
|
|
||||||
|
|
||||||
struct system_on_chip {
|
|
||||||
SOC soc_model;
|
|
||||||
VENDOR soc_vendor;
|
|
||||||
int32_t process;
|
|
||||||
char* soc_name;
|
|
||||||
char* raw_name;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct system_on_chip* get_soc(void);
|
struct system_on_chip* get_soc(void);
|
||||||
char* get_soc_name(struct system_on_chip* soc);
|
|
||||||
VENDOR get_soc_vendor(struct system_on_chip* soc);
|
|
||||||
char* get_str_process(struct system_on_chip* soc);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include "../arm/uarch.h"
|
#include "../arm/uarch.h"
|
||||||
#include "../arm/midr.h"
|
#include "../arm/midr.h"
|
||||||
#include "../arm/soc.h"
|
#include "../arm/soc.h"
|
||||||
|
#include "../common/soc.h"
|
||||||
#elif ARCH_RISCV
|
#elif ARCH_RISCV
|
||||||
#include "../riscv/riscv.h"
|
#include "../riscv/riscv.h"
|
||||||
#include "../riscv/uarch.h"
|
#include "../riscv/uarch.h"
|
||||||
|
|||||||
75
src/common/soc.c
Normal file
75
src/common/soc.c
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
#include "soc.h"
|
||||||
|
#ifdef ARCH_ARM
|
||||||
|
#include "../arm/socs.h"
|
||||||
|
#elif ARCH_RISCV
|
||||||
|
#include "../riscv/socs.h"
|
||||||
|
#endif
|
||||||
|
#include "udev.h"
|
||||||
|
#include "../common/global.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
static char* soc_trademark_string[] = {
|
||||||
|
// ARM
|
||||||
|
[SOC_VENDOR_SNAPDRAGON] = "Snapdragon ",
|
||||||
|
[SOC_VENDOR_MEDIATEK] = "MediaTek ",
|
||||||
|
[SOC_VENDOR_EXYNOS] = "Exynos ",
|
||||||
|
[SOC_VENDOR_KIRIN] = "Kirin ",
|
||||||
|
[SOC_VENDOR_BROADCOM] = "Broadcom BCM",
|
||||||
|
[SOC_VENDOR_APPLE] = "Apple ",
|
||||||
|
[SOC_VENDOR_ROCKCHIP] = "Rockchip ",
|
||||||
|
// RISC-V
|
||||||
|
[SOC_VENDOR_SIFIVE] = "SiFive ",
|
||||||
|
[SOC_VENDOR_STARFIVE] = "StarFive ",
|
||||||
|
// ARM & RISC-V
|
||||||
|
[SOC_VENDOR_ALLWINNER] = "Allwinner "
|
||||||
|
};
|
||||||
|
|
||||||
|
VENDOR get_soc_vendor(struct system_on_chip* soc) {
|
||||||
|
return soc->soc_vendor;
|
||||||
|
}
|
||||||
|
|
||||||
|
char* get_str_process(struct system_on_chip* soc) {
|
||||||
|
char* str;
|
||||||
|
|
||||||
|
if(soc->process == UNKNOWN) {
|
||||||
|
str = emalloc(sizeof(char) * (strlen(STRING_UNKNOWN)+1));
|
||||||
|
snprintf(str, strlen(STRING_UNKNOWN)+1, STRING_UNKNOWN);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
str = emalloc(sizeof(char) * 5);
|
||||||
|
memset(str, 0, sizeof(char) * 5);
|
||||||
|
snprintf(str, 5, "%dnm", soc->process);
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
char* get_soc_name(struct system_on_chip* soc) {
|
||||||
|
if(soc->soc_model == SOC_MODEL_UNKNOWN)
|
||||||
|
return soc->raw_name;
|
||||||
|
return soc->soc_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
void fill_soc(struct system_on_chip* soc, char* soc_name, SOC soc_model, int32_t process) {
|
||||||
|
soc->soc_model = soc_model;
|
||||||
|
soc->soc_vendor = get_soc_vendor_from_soc(soc_model);
|
||||||
|
soc->process = process;
|
||||||
|
int len = strlen(soc_name) + strlen(soc_trademark_string[soc->soc_vendor]) + 1;
|
||||||
|
soc->soc_name = emalloc(sizeof(char) * len);
|
||||||
|
memset(soc->soc_name, 0, sizeof(char) * len);
|
||||||
|
sprintf(soc->soc_name, "%s%s", soc_trademark_string[soc->soc_vendor], soc_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool match_soc(struct system_on_chip* soc, char* raw_name, char* expected_name, char* soc_name, SOC soc_model, int32_t process) {
|
||||||
|
int len1 = strlen(raw_name);
|
||||||
|
int len2 = strlen(expected_name);
|
||||||
|
int len = min(len1, len2);
|
||||||
|
|
||||||
|
if(strncmp(raw_name, expected_name, len) != 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
fill_soc(soc, soc_name, soc_model, process);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
52
src/common/soc.h
Normal file
52
src/common/soc.h
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
#ifndef __SOC__
|
||||||
|
#define __SOC__
|
||||||
|
|
||||||
|
// NOTE:
|
||||||
|
// soc.c/soc.h are used by
|
||||||
|
// ARM and RISC-V backends
|
||||||
|
|
||||||
|
#include "../common/cpu.h"
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#define UNKNOWN -1
|
||||||
|
|
||||||
|
typedef int32_t SOC;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SOC_VENDOR_UNKNOWN,
|
||||||
|
// ARM
|
||||||
|
SOC_VENDOR_SNAPDRAGON,
|
||||||
|
SOC_VENDOR_MEDIATEK,
|
||||||
|
SOC_VENDOR_EXYNOS,
|
||||||
|
SOC_VENDOR_KIRIN,
|
||||||
|
SOC_VENDOR_BROADCOM,
|
||||||
|
SOC_VENDOR_APPLE,
|
||||||
|
SOC_VENDOR_ROCKCHIP,
|
||||||
|
// RISC-V
|
||||||
|
SOC_VENDOR_SIFIVE,
|
||||||
|
SOC_VENDOR_STARFIVE,
|
||||||
|
// ARM & RISC-V
|
||||||
|
SOC_VENDOR_ALLWINNER
|
||||||
|
};
|
||||||
|
|
||||||
|
struct system_on_chip {
|
||||||
|
SOC soc_model;
|
||||||
|
VENDOR soc_vendor;
|
||||||
|
int32_t process;
|
||||||
|
char* soc_name;
|
||||||
|
char* raw_name;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct system_on_chip* get_soc(void);
|
||||||
|
char* get_soc_name(struct system_on_chip* soc);
|
||||||
|
VENDOR get_soc_vendor(struct system_on_chip* soc);
|
||||||
|
bool match_soc(struct system_on_chip* soc, char* raw_name, char* expected_name, char* soc_name, SOC soc_model, int32_t process);
|
||||||
|
char* get_str_process(struct system_on_chip* soc);
|
||||||
|
void fill_soc(struct system_on_chip* soc, char* soc_name, SOC soc_model, int32_t process);
|
||||||
|
|
||||||
|
#define SOC_START if (false) {}
|
||||||
|
#define SOC_EQ(raw_name, expected_name, soc_name, soc_model, soc, process) \
|
||||||
|
else if (match_soc(soc, raw_name, expected_name, soc_name, soc_model, process)) return true;
|
||||||
|
#define SOC_END else { return false; }
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -5,66 +5,6 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
VENDOR get_soc_vendor(struct system_on_chip* soc) {
|
|
||||||
return soc->soc_vendor;
|
|
||||||
}
|
|
||||||
|
|
||||||
char* get_str_process(struct system_on_chip* soc) {
|
|
||||||
char* str;
|
|
||||||
|
|
||||||
if(soc->process == UNKNOWN) {
|
|
||||||
str = emalloc(sizeof(char) * (strlen(STRING_UNKNOWN)+1));
|
|
||||||
snprintf(str, strlen(STRING_UNKNOWN)+1, STRING_UNKNOWN);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
str = emalloc(sizeof(char) * 5);
|
|
||||||
memset(str, 0, sizeof(char) * 5);
|
|
||||||
snprintf(str, 5, "%dnm", soc->process);
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
char* get_soc_name(struct system_on_chip* soc) {
|
|
||||||
if(soc->soc_model == SOC_MODEL_UNKNOWN)
|
|
||||||
return soc->raw_name;
|
|
||||||
return soc->soc_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
static char* soc_trademark_string[] = {
|
|
||||||
[SOC_VENDOR_SIFIVE] = "SiFive ",
|
|
||||||
[SOC_VENDOR_STARFIVE] = "StarFive ",
|
|
||||||
[SOC_VENDOR_ALLWINNER] = "Allwinner "
|
|
||||||
};
|
|
||||||
|
|
||||||
void fill_soc(struct system_on_chip* soc, char* soc_name, SOC soc_model, int32_t process) {
|
|
||||||
soc->soc_model = soc_model;
|
|
||||||
soc->soc_vendor = get_soc_vendor_from_soc(soc_model);
|
|
||||||
soc->process = process;
|
|
||||||
int len = strlen(soc_name) + strlen(soc_trademark_string[soc->soc_vendor]) + 1;
|
|
||||||
soc->soc_name = emalloc(sizeof(char) * len);
|
|
||||||
memset(soc->soc_name, 0, sizeof(char) * len);
|
|
||||||
sprintf(soc->soc_name, "%s%s", soc_trademark_string[soc->soc_vendor], soc_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool match_soc(struct system_on_chip* soc, char* raw_name, char* expected_name, char* soc_name, SOC soc_model, int32_t process) {
|
|
||||||
int len1 = strlen(raw_name);
|
|
||||||
int len2 = strlen(expected_name);
|
|
||||||
int len = min(len1, len2);
|
|
||||||
|
|
||||||
if(strncmp(raw_name, expected_name, len) != 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
fill_soc(soc, soc_name, soc_model, process);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#define SOC_START if (false) {}
|
|
||||||
#define SOC_EQ(raw_name, expected_name, soc_name, soc_model, soc, process) \
|
|
||||||
else if (match_soc(soc, raw_name, expected_name, soc_name, soc_model, process)) return true;
|
|
||||||
#define SOC_END else { return false; }
|
|
||||||
|
|
||||||
bool match_sifive(char* soc_name, struct system_on_chip* soc) {
|
bool match_sifive(char* soc_name, struct system_on_chip* soc) {
|
||||||
char* tmp = soc_name;
|
char* tmp = soc_name;
|
||||||
|
|
||||||
|
|||||||
@@ -1,29 +1,10 @@
|
|||||||
#ifndef __SOC__
|
#ifndef __SOC_RISCV__
|
||||||
#define __SOC__
|
#define __SOC_RISCV__
|
||||||
|
|
||||||
|
#include "../common/soc.h"
|
||||||
#include "../common/cpu.h"
|
#include "../common/cpu.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
typedef int32_t SOC;
|
|
||||||
|
|
||||||
enum {
|
|
||||||
SOC_VENDOR_UNKNOWN,
|
|
||||||
SOC_VENDOR_SIFIVE,
|
|
||||||
SOC_VENDOR_STARFIVE,
|
|
||||||
SOC_VENDOR_ALLWINNER
|
|
||||||
};
|
|
||||||
|
|
||||||
struct system_on_chip {
|
|
||||||
SOC soc_model;
|
|
||||||
VENDOR soc_vendor;
|
|
||||||
int32_t process;
|
|
||||||
char* soc_name;
|
|
||||||
char* raw_name;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct system_on_chip* get_soc(void);
|
struct system_on_chip* get_soc(void);
|
||||||
char* get_soc_name(struct system_on_chip* soc);
|
|
||||||
VENDOR get_soc_vendor(struct system_on_chip* soc);
|
|
||||||
char* get_str_process(struct system_on_chip* soc);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user