Browse Source

[ZARCH] Restore detect() function

tags/v0.3.6^2
maamountki GitHub 7 years ago
parent
commit
453bfa7e71
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 3 deletions
  1. +23
    -3
      cpuid_zarch.c

+ 23
- 3
cpuid_zarch.c View File

@@ -45,9 +45,29 @@ static char *cpuname_lower[] = {

int detect(void)
{
// return CPU_GENERIC;
return CPU_Z14;
FILE *infile;
char buffer[512], *p;

p = (char *)NULL;
infile = fopen("/proc/sysinfo", "r");
while (fgets(buffer, sizeof(buffer), infile)){
if (!strncmp("Type", buffer, 4)){
p = strchr(buffer, ':') + 2;
#if 0
fprintf(stderr, "%s\n", p);
#endif
break;
}
}

fclose(infile);

if (strstr(p, "2964")) return CPU_Z13;
if (strstr(p, "2965")) return CPU_Z13;
if (strstr(p, "3906")) return CPU_Z14;
if (strstr(p, "3907")) return CPU_Z14;

return CPU_GENERIC;
}

void get_libname(void)


Loading…
Cancel
Save