We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2322901 commit 453bfa7Copy full SHA for 453bfa7
cpuid_zarch.c
@@ -45,9 +45,29 @@ static char *cpuname_lower[] = {
45
46
int detect(void)
47
{
48
- // return CPU_GENERIC;
49
- return CPU_Z14;
50
-
+ FILE *infile;
+ char buffer[512], *p;
+
51
+ p = (char *)NULL;
52
+ infile = fopen("/proc/sysinfo", "r");
53
+ while (fgets(buffer, sizeof(buffer), infile)){
54
+ if (!strncmp("Type", buffer, 4)){
55
+ p = strchr(buffer, ':') + 2;
56
+#if 0
57
+ fprintf(stderr, "%s\n", p);
58
+#endif
59
+ break;
60
+ }
61
62
63
+ fclose(infile);
64
65
+ if (strstr(p, "2964")) return CPU_Z13;
66
+ if (strstr(p, "2965")) return CPU_Z13;
67
+ if (strstr(p, "3906")) return CPU_Z14;
68
+ if (strstr(p, "3907")) return CPU_Z14;
69
70
+ return CPU_GENERIC;
71
}
72
73
void get_libname(void)
0 commit comments