Skip to content

Commit

Permalink
Detect ARMV8 on 32-bit mode by using ARMV7 kernels.
Browse files Browse the repository at this point in the history
  • Loading branch information
xianyi committed Jan 28, 2016
1 parent c44ff4d commit be95bda
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cpuid_arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit be95bda

Please sign in to comment.