mirror of https://github.com/BOINC/boinc.git
Client: test cpu detection on aarch64 (armv8)
This commit is contained in:
parent
1285474ca1
commit
a6675cf29e
|
@ -56,6 +56,10 @@ int main(void) {
|
||||||
#elif __arm__
|
#elif __arm__
|
||||||
strcpy(p_vendor, "ARM ");
|
strcpy(p_vendor, "ARM ");
|
||||||
vendor_hack = vendor_found = true;
|
vendor_hack = vendor_found = true;
|
||||||
|
#elif __aarch64__
|
||||||
|
strcpy(p_vendor, "ARM ");
|
||||||
|
vendor_hack = vendor_found = true;
|
||||||
|
model_hack = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
strcpy(features, "");
|
strcpy(features, "");
|
||||||
|
@ -96,6 +100,9 @@ int main(void) {
|
||||||
strstr(buf, "cpu\t\t: ")
|
strstr(buf, "cpu\t\t: ")
|
||||||
#elif __arm__
|
#elif __arm__
|
||||||
strstr(buf, "Processor\t: ") || strstr(buf, "model name")
|
strstr(buf, "Processor\t: ") || strstr(buf, "model name")
|
||||||
|
#elif __aarch64__
|
||||||
|
// Hardware is a fallback available on ODROID devices
|
||||||
|
strstr(buf, "Processor\t: ") || strstr(buf, "CPU architecture: ") || strstr(buf, "Hardware\t: ")
|
||||||
#else
|
#else
|
||||||
strstr(buf, "model name\t: ") || strstr(buf, "cpu model\t\t: ")
|
strstr(buf, "model name\t: ") || strstr(buf, "cpu model\t\t: ")
|
||||||
#endif
|
#endif
|
||||||
|
@ -122,6 +129,18 @@ int main(void) {
|
||||||
family = atoi(testc);
|
family = atoi(testc);
|
||||||
continue; /* skip this line */
|
continue; /* skip this line */
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef __aarch64__
|
||||||
|
/* depending on kernel version, CPU architecture can either be
|
||||||
|
* a number or a string. If a string, we have a model name, else we don't
|
||||||
|
* also checks "Hardware" for ODROID devices as a fallback*/
|
||||||
|
char *testc = NULL;
|
||||||
|
testc = strrchr(buf, ':')+2;
|
||||||
|
if (!isdigit(*testc)) {
|
||||||
|
model_found = true;
|
||||||
|
strlcpy(p_model, strchr(buf, ':') + 2, sizeof(p_model));
|
||||||
|
continue; /* skip this line */
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
model_found = true;
|
model_found = true;
|
||||||
strlcpy(buf2, strchr(buf, ':') + 2, sizeof(p_model) - strlen(p_model) - 1);
|
strlcpy(buf2, strchr(buf, ':') + 2, sizeof(p_model) - strlen(p_model) - 1);
|
||||||
|
|
Loading…
Reference in New Issue