mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-26 23:10:38 +00:00
Fix get CPU & CPU Brand
This commit is contained in:
parent
bd8759853b
commit
9ac4931636
@ -33,11 +33,19 @@ const char procfile[] = "/proc/cpuinfo";
|
||||
const char syscpupresentfile[] = "/sys/devices/system/cpu/present";
|
||||
|
||||
std::string GetCPUString() {
|
||||
//TODO
|
||||
std::string cpu_string;
|
||||
cpu_string = "Unknown";
|
||||
return cpu_string;
|
||||
}
|
||||
|
||||
std::string GetCPUBrandString() {
|
||||
//TODO
|
||||
std::string brand_string;
|
||||
brand_string = "Unknown";
|
||||
return brand_string;
|
||||
}
|
||||
|
||||
int GetCoreCount()
|
||||
{
|
||||
std::string line, marker = "processor\t: ";
|
||||
@ -99,7 +107,8 @@ void CPUInfo::Detect()
|
||||
#if !defined(__linux__)
|
||||
num_cores = 1;
|
||||
#else // __linux__
|
||||
strncpy(cpu_string, GetCPUString().c_str(), sizeof(cpu_string));
|
||||
truncate_cpy(cpu_string, GetCPUString().c_str());
|
||||
truncate_cpy(brand_string, GetCPUBrandString().c_str());
|
||||
num_cores = GetCoreCount();
|
||||
#endif
|
||||
}
|
||||
@ -114,6 +123,8 @@ std::string CPUInfo::Summarize()
|
||||
sum = StringFromFormat("%s, %i cores", cpu_string, num_cores);
|
||||
if (CPU64bit) sum += ", 64-bit";
|
||||
|
||||
//TODO: parse "isa : rv64imafdc" from /proc/cpuinfo
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user