Detect ARMV8 on 32-bit mode by using ARMV7 kernels.
This commit is contained in:
parent
c44ff4d648
commit
be95bdaf47
24
cpuid_arm.c
24
cpuid_arm.c
|
@ -115,6 +115,9 @@ int detect(void)
|
||||||
if (strstr(p, "0xc0f")) {
|
if (strstr(p, "0xc0f")) {
|
||||||
return CPU_CORTEXA15;
|
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
|
#endif
|
||||||
|
|
||||||
return CPU_UNKNOWN;
|
return CPU_UNKNOWN;
|
||||||
|
|
Loading…
Reference in New Issue