+ char buf [512];
+ char *line;
+ FILE *file = fopen ("/proc/cpuinfo", "r");
+ if (file) {
+ while ((line = fgets (buf, 512, file))) {
+ if (strncmp (line, "Processor", 9) == 0) {
+ char *ver = strstr (line, "(v");
+ if (ver && (ver [2] == '5' || ver [2] == '6' || ver [2] == '7')) {
+ v5_supported = TRUE;
+ }
+ continue;
+ }
+ if (strncmp (line, "Features", 8) == 0) {
+ char *th = strstr (line, "thumb");
+ if (th) {
+ thumb_supported = TRUE;
+ if (v5_supported)
+ break;
+ }
+ continue;
+ }
+ }
+ fclose (file);
+ /*printf ("features: v5: %d, thumb: %d\n", v5_supported, thumb_supported);*/
+ }