[v1.03][PPC] Implement hypervisor detection in PowerPC

This commit is contained in:
Dr-Noob
2023-05-04 18:56:31 +02:00
parent ebe7312c9d
commit 0397db2fd8
7 changed files with 63 additions and 6 deletions

View File

@@ -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;
}