Browse Source

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

tags/v0.2.16.rc1
Zhang Xianyi 10 years ago
parent
commit
be95bdaf47
1 changed files with 24 additions and 0 deletions
  1. +24
    -0
      cpuid_arm.c

+ 24
- 0
cpuid_arm.c 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;


Loading…
Cancel
Save