mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-24 23:40:39 +01:00
WIP
This commit is contained in:
@@ -1056,7 +1056,7 @@ struct system_on_chip* guess_soc_from_devtree(struct system_on_chip* soc) {
|
|||||||
// come directly from the device tree, meaning that it will likely be less precise.
|
// come directly from the device tree, meaning that it will likely be less precise.
|
||||||
struct system_on_chip* guess_raw_soc_from_devtree(struct system_on_chip* soc) {
|
struct system_on_chip* guess_raw_soc_from_devtree(struct system_on_chip* soc) {
|
||||||
int num_vendors;
|
int num_vendors;
|
||||||
struct devtree** dt_vendors = get_devtree_compatible_vendors(&num_vendors);
|
struct devtree** dt_vendors = get_devtree_compatible_struct(&num_vendors);
|
||||||
if (dt_vendors == NULL) {
|
if (dt_vendors == NULL) {
|
||||||
return soc;
|
return soc;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ void fill_soc(struct system_on_chip* soc, char* soc_name, SOC soc_model, int32_t
|
|||||||
void fill_soc_raw(struct system_on_chip* soc, char* soc_name, VENDOR vendor) {
|
void fill_soc_raw(struct system_on_chip* soc, char* soc_name, VENDOR vendor) {
|
||||||
soc->model = SOC_MODEL_UNKNOWN;
|
soc->model = SOC_MODEL_UNKNOWN;
|
||||||
soc->vendor = vendor;
|
soc->vendor = vendor;
|
||||||
soc->process = UNK;
|
soc->process = UNKNOWN;
|
||||||
|
|
||||||
int len = strlen(soc_name) + strlen(soc_trademark_string[soc->vendor]) + 1;
|
int len = strlen(soc_name) + strlen(soc_trademark_string[soc->vendor]) + 1;
|
||||||
soc->name = emalloc(sizeof(char) * len);
|
soc->name = emalloc(sizeof(char) * len);
|
||||||
|
|||||||
@@ -394,7 +394,7 @@ struct devtree** get_devtree_compatible_struct(int *num_vendors_ptr) {
|
|||||||
int vendor_str_len = (comma_ptr-ptr)+1;
|
int vendor_str_len = (comma_ptr-ptr)+1;
|
||||||
int model_str_len = (end_ptr-comma_ptr)+1;
|
int model_str_len = (end_ptr-comma_ptr)+1;
|
||||||
|
|
||||||
vendors[i] = emalloc(struct devtree);
|
vendors[i] = emalloc(sizeof(struct devtree));
|
||||||
vendors[i]->vendor = ecalloc(vendor_str_len, sizeof(char));
|
vendors[i]->vendor = ecalloc(vendor_str_len, sizeof(char));
|
||||||
vendors[i]->model = ecalloc(model_str_len, sizeof(char));
|
vendors[i]->model = ecalloc(model_str_len, sizeof(char));
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
struct devtree {
|
struct devtree {
|
||||||
char* vendor;
|
char* vendor;
|
||||||
char* model;
|
char* model;
|
||||||
}
|
};
|
||||||
|
|
||||||
char* read_file(char* path, int* len);
|
char* read_file(char* path, int* len);
|
||||||
long get_max_freq_from_file(uint32_t core);
|
long get_max_freq_from_file(uint32_t core);
|
||||||
|
|||||||
Reference in New Issue
Block a user