mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-26 16:30:38 +01:00
[v1.03][PPC] Implement hypervisor detection in PowerPC
This commit is contained in:
@@ -374,3 +374,18 @@ int get_num_sockets_package_cpus(struct topology* topo) {
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Inspired in is_devtree_compatible from lscpu
|
||||
bool is_devtree_compatible(char* str) {
|
||||
int filelen;
|
||||
char* buf;
|
||||
if((buf = read_file("/proc/device-tree/compatible", &filelen)) == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
char* tmp;
|
||||
if((tmp = strstr(buf, str)) == NULL) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user