Detect ARMV8 on 32-bit mode by using ARMV7 kernels.

This commit is contained in:
Zhang Xianyi 2016-01-28 17:30:26 +00:00
parent c44ff4d648
commit be95bdaf47
1 changed files with 24 additions and 0 deletions

View File

@ -115,6 +115,9 @@ int detect(void)
if (strstr(p, "0xc0f")) {
return CPU_CORTEXA15;
}
if (strstr(p, "0xd07")) {
return CPU_ARMV7; //ARMV8 on 32-bit
}
}
@ -158,6 +161,27 @@ int detect(void)
}
p = (char *) NULL ;
infile = fopen("/proc/cpuinfo", "r");
while (fgets(buffer, sizeof(buffer), infile))
{
if ((!strncmp("CPU architecture", buffer, 16)))
{
p = strchr(buffer, ':') + 2;
break;
}
}
fclose(infile);
if(p != NULL) {
if (strstr(p, "8")) {
return CPU_ARMV7; //ARMV8 on 32-bit
}
}
#endif
return CPU_UNKNOWN;